you are such a great instructor. most people would just say "then we type this" but you explain the most important part: the WHY. you da best. and you are a great coder. ive already learned so many cool new tricks and things ive never picked up from tons of videos already. thank you.
@Selfency Жыл бұрын
Cannot agree more. When watching other "tutorials" they don't care to teach you, it's basically just "copy this and run it" like, bro I can copy and paste code all day that isn't going to make me understand it. Meanwhile, this guy has the most organized and comprehensive workflow out of them all and explains it better than anyone else either. Cannot thank him enough.
@Zygmuntt3 жыл бұрын
Absolute chad! Thanks a lot, this is the only tutorial I could find that isn't half an hour long and works.
@Savaril3 жыл бұрын
Thank you for this tutorial, it's the only one I could find on youtube that actually produced good results that were feasible for a real game and not just a demo
@IAmViolencity Жыл бұрын
Same! This guy is actually such a chad
@TheBackroomsSmiler11 күн бұрын
As a beginner to c#, your tutorials are amazing, tysm
@liornaveh192 Жыл бұрын
Its my first time in Unity and i wanted to make a FPS game and your tutorials are so good so thank u so much bro!!!!
@PlayBAT10 ай бұрын
Dude, you're the best! No one on KZbin can explain it so clearly!👍
@qroundhawk71493 жыл бұрын
This series is amazing, keep up the good work men. Hoop this channel blows up for tutorials because you explain it so clearly and calm.
@WizardMonke2 жыл бұрын
Love your tutorials. The code is organized and satisfying to write, and I love the flexibility that you've given this controller to really be used in any FPS. Also you explain things very concisely and clearly. Keep up the good work!
@Wheiejdj27383 Жыл бұрын
actually amazing help me very much keep up the good work
@swzwij3 жыл бұрын
Could you also do an episode where you implement foot steps into the character controllers
@168games-i6p25 күн бұрын
Thank you for teaching us, I wish you the best!
@sumgue49645 ай бұрын
8:43 this tutorial be bumping broooo 😂
@Rise20343 жыл бұрын
I hate the youtube algorithm!🤬 you deserve wayyyy more view and like! anyway just keep it mind that this is so great its help me a lot every time!
@comp3interactive3 жыл бұрын
Thanks man, that means a lot! Glad it's helping! I'm slowly creeping up in my analytics so hopefully soon enough I'll get a video that booms! 😂
@H1zoneTv3 жыл бұрын
Man you one of the bests!!!
@joshuahillary33123 жыл бұрын
So glad Tyson Fury is teaching me unity
@comp3interactive3 жыл бұрын
First time I've had that one... I've had Sean Bean and Kane from WWE but never Tyson Fury 😂
@lumberapple8820 Жыл бұрын
Thank you, you are a saint. This worked perfectly and i actually understand what you are saying :). Subbed!
@priestartor90652 жыл бұрын
Thanks this was simple and just what I was looking for
@zbeb1183 жыл бұрын
Hey, great video but there is just one little bug, with this current bob it only moves the camera when the movedir.x or movedir.z are > 0.1 so if you move just a bit the camera moves down a bit stays down and doesnt move back up until you start moving again. Is there any work around?
@KH2FanLover3 жыл бұрын
On the ''HandleHeadbob'' void, after the second if, put this: else { timer += Time.deltaTime * (isCrouching ? crouchBobSpeed : IsSprinting ? sprintBobSpeed : walkBobSpeed); playerCamera.transform.localPosition = new Vector3(playerCamera.transform.localPosition.x, defaultYPos, playerCamera.transform.localPosition.z); }
@Heperoo3 жыл бұрын
@@KH2FanLover Worked, thanks!
@qroundhawk71493 жыл бұрын
@@KH2FanLover You should make another check: else if(defaultYPos != playerCamera.transform.localPosition.y) so the else wont be called every frame only once to bring it back to defaultYPos
@KH2FanLover3 жыл бұрын
@@qroundhawk7149 Oh true! Thanks!
@bshaun27402 жыл бұрын
@@KH2FanLover To add on to this even more, here's some code to make the return to the default height smoother. Create your own float variable for the animation speed and name it (timeToReturn), then run this coroutine on the third if statement (the one provided by Qroundhawk) to interpolate the vectors return to the default height value. Here's the code: private IEnumerator LevelHeight() { if (duringCrouchAnimation) { yield break; } duringLevelHeightAnimation = true; float timeElapsed = 0; Vector3 currentHeight = playerCamera.transform.localPosition; Vector3 targetHeight; targetHeight = new Vector3(playerCamera.transform.localPosition.x, defaultYPos, playerCamera.transform.localPosition.z); while (timeElapsed < timeToReturn) { playerCamera.transform.localPosition = Vector3.Lerp(currentHeight, targetHeight, timeElapsed / timeToReturn); timeElapsed += Time.deltaTime; yield return null; } duringLevelHeightAnimation = false; }
@tincoES Жыл бұрын
amazing tutorials dude thanks a lot...
@anfrollex Жыл бұрын
Keep it up! Amazing!
@veteranfighter693 жыл бұрын
Great video, keep on!
@estebanruiz67642 жыл бұрын
great tutorial, thank you
@qazmyas97272 жыл бұрын
Thank you! Great tutorial!
@koferperk3 жыл бұрын
very cool! thanks man
@Bat_pann3 жыл бұрын
Perfect.
@AlejandroArch223 жыл бұрын
When i first start walking with the headbob enabled For some reason It lowers my hieght. Not sure if its the characterController hieght or the playerCamera height.
@ike7093 Жыл бұрын
When ever I move the camera moves down to the center of the player. When ever I couch... I cannot uncrouch. Help please
@rebornkevin78743 жыл бұрын
I'm sort of a new person to Unity and these videos have helped me a lot, just a question if you don't mind. Any plans to make a tutorial on how to make footsteps SFX? Like whenever you walk a sound effect plays such as wood creaking, concrete?
@comp3interactive3 жыл бұрын
For sure man. That's going to be one of the episodes in the series!
@rebornkevin78743 жыл бұрын
@@comp3interactive Amazing! I can't wait for that tutorial, I'm attempting to do a PS1-styled horror game and stumbled upon your channel. Thank you so much for this.
@gerritson7178 Жыл бұрын
how do I make it go a little to side
@jud.su.5developer8952 жыл бұрын
You are great 👍🏿
@KIXEMITNOG3 жыл бұрын
Nice!
@vieirapereira12983 жыл бұрын
hey! great video once again! following and learning this controller! but i ran into a bug, as i walk my camera goes to the middle of the capsule and doesnt return. it does the bob from there, is very weird. i tried disable the crouch and nothing, can someone help ?
@IlIlIIIIlIlIIlIll2 жыл бұрын
did you find a fix?
@skaruts2 жыл бұрын
Check where you set the *defaultYPos* inside *Awake,* to see if you didn't use *position* instead of *localPosition* by mistake. It should be *localPosition.*
@KushagraPratap3 жыл бұрын
I subscribed for you accent, and I dont regret it. Please give some tips for first person games to look more alive
@comp3interactive3 жыл бұрын
You know, the thing that stopped me from starting up a KZbin channel sooner was my voice. I didn't think it was that easy to understand, especially to a foreign audience, but I haven't had many negative comments about it and also my analytics show only 6% use subtitles... Learn to love yourself ♥ 😂
@comp3interactive3 жыл бұрын
In regards to more FPS tutorials, once this controller series is fleshed out then we'll be using this controller in further FPS tutorials. It just seemed logical to get the controller completed first
@KushagraPratap3 жыл бұрын
@@comp3interactive I used to watch with someone similar accent, LaffenGas, a minecraft youtuber, and I still watch him not bcoz I like his content, but just bcoz his accent, its kinda addicting
@comp3interactive3 жыл бұрын
You'll have to join a drunken Live stream at some point after I've moved house... After a few drinks my voice gets a lot broader 😂
@KushagraPratap3 жыл бұрын
@@comp3interactive lol
@poseidon56023 жыл бұрын
Are you going to make full body fps controller like adding hands,legs ,body?
@comp3interactive3 жыл бұрын
I can definitely add an episode where we add it the body mesh!
@poseidon56023 жыл бұрын
@@comp3interactive Ok thank you ! I am waiting
@comp3interactive3 жыл бұрын
If you're new here then just a heads up, there might be a little gap in uploads soon because I moved house yesterday, but I'll be back as soon as I get my office set up!
@grooviss6192 жыл бұрын
Camera wont return to defaultYPos. Any ideas?
@MarsLaaars2 жыл бұрын
same for me also
@MarsLaaars2 жыл бұрын
fixed it 😅, I had written 'defaultYPos = Mathf.Sin(timer)' instead of "defaultYPos + Mathf.Sin(timer)"
@featherless6562 жыл бұрын
I did everything in the tutorial, but instead of bobbing, it just kinda doesn't do anything
@rycrft3 жыл бұрын
Just a question, since being new to scripting and such I am learning lot's from this! But is it okay to use your same script for a published game in the future?
@comp3interactive3 жыл бұрын
Yeah man for sure, use it, tweak it, just learn from it... Do whatever you like with it
@rycrft3 жыл бұрын
@@comp3interactive Perfect! Thank you very much! Great vids! Also one more question, would you be able to do a prone script?
@comp3interactive3 жыл бұрын
It's on my "to do" list, I'm just taking a little break from recording at the moment but I should be back at it soon enough
@rycrft3 жыл бұрын
@@comp3interactive No worries! Take your time!
@trapeface Жыл бұрын
For others who find themselves expanding on the technique... Left as-was for my purposes, just a "thought for food"....almost gave up the troll-ish share for format/clarity grief- protected float MatchParameter(string context = null) { if(context == "bob") return isSprinting ? _sprintBobSpeed : _isCrouching ? _crouchBobSpeed : _walkBobSpeed; return isSprinting ? _sprintSpeed : _isCrouching ? _crouchSpeed : _walkSpeed; } // which allows in head bob method: timer += Time.deltaTime * MatchParameter("bob"); // elsewhere _currentInput = new Vector2(Input.GetAxis("...") * MatchParameter(), ....
@Snai1TankProductions2 жыл бұрын
My headbob is happening even when I'm standing still... Have I missed something?
@timtrollgasm Жыл бұрын
Yeah I got that issue too. did you ever get it fixed? If so how?
@TheMavryan11 ай бұрын
@@timtrollgasm Hey, I just got this issue and realised I had put a semi colon on the end of if (Mathf.Abs(moveDirection.x) > 0.1f || Mathf.Abs(moveDirection.z) > 0.1f) Once I removed the semicolon then the bobbing worked correctly when idle. Hopefully this helps!
@timtrollgasm11 ай бұрын
Thanks!@@TheMavryan
@CHTOUROU_BECHIR3 жыл бұрын
I agree with "Rise 2034", the number of views is not fair considering the quality of the tutorials, I find it weird, I know a certain Englishman who has a tutorial channel and who has more than 120k of subscribers and I know his lessons suck, needless to say who he is (he does sequencing and not programming ...) and yet he has so many subscribers !!!!! It is unfair.
@t0xangames207 Жыл бұрын
5:52 Vector3.magnitude.....
@ИсламКаримов-т9ь3 жыл бұрын
hey man very good code but you need make "isCrouching ? crouchBobSpeed : IsSprinting ? sprintBobSpeed : walkBobSpeed" as property like below float BobSpeed => isCrouching ? crouchBobSpeed : IsSprinting ? sprintBobSpeed : walkBobSpeed;
@souldarktemplar Жыл бұрын
Greetings, I have followed your tutorial as best as I can, not exactly 'verbatim', but I tried to cram all the technics and insight and stuff in my head but I am just absolutely stumped one single thing. The headbob doesn't seem to trigger for when crouching. Any other movement, walking, sprinting works but not crouching. I have tried logging if my isCrouching is being finicky but so far it has not been that way, especially when the part that checks for any ceiling while crouching works as intended. May I ask for any comment on this? I could leave it as is and just animate whatever stuff the player would be holding as I am assuming the player shall be holding a weapon or item for most if not all of the time but I would really like to see it fixed so I may feel it out and stuff.... Thank you in advance..
@The-Cheph2 жыл бұрын
I did everything right and its not headbobbing
@The-Cheph2 жыл бұрын
no errors
@internalreadonlyvoid52833 жыл бұрын
Cool tut. But Having one script that controls everything... Not good. Yes, u can disable some features...
@thepolygonpilgrimage3 жыл бұрын
What in your opinion would be better? Too many tiny scripts becomes cumbersome. IMO a master script for a player controller makes perfect sense; contain all player functions to one place. Otherwise to make sweeping changes or even simple ones you would need to go all over the place. This is far less messy and far more efficient.
@comp3interactive3 жыл бұрын
I know what you mean but I disagree with that in this instance. If it becomes too large then it can be split up to partials but for a single entity such as a first person controller it's fine to contain everything in a single master class, it cuts down on local references to other sub-classes which you need to monitor on scene change to make sure they're still intact
@LitNotFig2 жыл бұрын
Its not working, I checked the code and its exactly the same.
@KalebShewangizaw-b7i Жыл бұрын
Plis c# script
@LitNotFig3 жыл бұрын
It is going way too fast
@comp3interactive3 жыл бұрын
Slow it down then, there's speed variables right there in the inspector
@gaspardfrancois71392 жыл бұрын
doesn't fucking work i have 43 errors
@comp3interactive2 жыл бұрын
Lol. So you mean YOUR code doesn't work, not the tutorial. Probably follow it again a bit more closely
@gaspardfrancois71392 жыл бұрын
@@comp3interactive bruh il gonna kms its faster
@comp3interactive2 жыл бұрын
Nice. Healthy mentality right there
@gaspardfrancois71392 жыл бұрын
@@comp3interactive btw how do u type the two weird characters at 5:36?
@comp3interactive2 жыл бұрын
The pipe? It's just a key on your keyboard
@Tammichdrawz11 ай бұрын
unfortunately the head bob for sprinting doesnt work i'm floating, { if (!characterController.isGrounded) return; float speedMultiplier = IsSprinting ? SprintWalkSpeed : WalkBobSpeed; // Use the correct variable float headBob = Mathf.Sin(timer * speedMultiplier) * (IsSprinting ? SprintBobAmount : WalkBobAmount); PlayerCamera.transform.localPosition = new Vector3( PlayerCamera.transform.localPosition.x, defaultYPos + headBob, PlayerCamera.transform.localPosition.z ); if (Mathf.Abs(characterController.velocity.x) > 0.1f || Mathf.Abs(characterController.velocity.z) > 0.1f) { timer += Time.deltaTime; } else { timer = 0f; } } is what i'm using but when i used yours it still didnt work