Tremendous tutorial, sir. Unlike some C# wizards out there, you actually take the time to lay out the why behind your code in a way that teaches strongly. Thanks very much!
@SingleSapling2 жыл бұрын
:)
@letmedoit.3 жыл бұрын
One of the best ways to explain character controller and animator controller Watched so many KZbinrs didn't get it But thanks to you for making this , keep going
@Etherealscorpions3 жыл бұрын
For anyone that's struggling with the last part of the video - the "making the legs walk while we swing our sword part", what worked for me was going to the Avatar Mask, going back to that green human-shaped interface, and making the legs red. Because the model used in this video is, in fact, a humanoid, and not a generic as the video claims. Aside from this one thing, the video is great and answered a lot of questions I didn't even know how to ask. PS: adding (anim.GetLayerWeight(1) == 0) to your attack check in the update function will ensure you don't start another attack animation while one is already playing.
@sreelol73763 жыл бұрын
thanks dude
@Gijs91142 жыл бұрын
I tried this but once i add `` && (anim.GetLayerWeight(1) == 0) `` to the if statements condition check i can't attack
@Etherealscorpions2 жыл бұрын
@@Gijs9114 to doublecheck, your update function looks like: private void Update() { Move(); if (Input.GetKeyDown(KeyCode.Mouse0) && (anim.GetLayerWeight(1) == 0)) { Attack(); } } and doesn't work?
@Gijs91142 жыл бұрын
@@Etherealscorpions almost exactly. i still have written StartCoroutine(Attack()); instead of just Attack();
@Etherealscorpions2 жыл бұрын
@@Gijs9114 ah right, i forgot i changed it a bit. I modified the code a bit in order to test out a combo attack feature. here's the code for that, in case it helps: private void Attack() { Debug.Log("Attack!"); if (Attack1combo) { StartCoroutine(Attack1()); } else if (Attack2combo) { StartCoroutine(Attack2()); } } private IEnumerator Attack1() { anim.SetLayerWeight(anim.GetLayerIndex("AttackLayer"), 1); anim.SetTrigger("Attack1"); yield return new WaitForSeconds(0.7f); anim.SetLayerWeight(anim.GetLayerIndex("AttackLayer"), 0); Attack2combo = true; Attack1combo = false; yield return new WaitForSeconds(0.5f); Attack2combo = false; Attack1combo = true; } private IEnumerator Attack2() { anim.SetLayerWeight(anim.GetLayerIndex("AttackLayer"), 1); anim.SetTrigger("Attack2"); yield return new WaitForSeconds(0.5f); anim.SetLayerWeight(anim.GetLayerIndex("AttackLayer"), 0); }
@ZackDaly3 жыл бұрын
Best intro ever. A rare occasion where I jumped out of full screen specifically to like and subscribe, 10 seconds into a video of a content creator I’ve never heard of. Awesome. How did he know exactly how Christmas goes for me!? EVERY. SINGLE. YEAR.
@dkordy3 жыл бұрын
oh my god, i learned more here with you than i watched 50 of some other tutorials. You are fantastic and fun and very concise. I like you a lot, I really learned more with your tutorial than I listened to fifty others (I repeat, but I have to repeat). Thank you very much! This is the first, your tutorial that I looked at(because I was searching for character control with animation), so after this I can only say that I hope you have more content like this. You really helped me! Thank you!
@dkordy3 жыл бұрын
and when you say=God damn it....soo ..sweet..
@yab04114 жыл бұрын
Been watching lots of character controller tutorials, and this is definitely the best I found
@unitygamedev59513 жыл бұрын
for sure it is
@mikoseru55693 жыл бұрын
I agree!
@SingleSapling3 жыл бұрын
Ah shiiit thanks
@snakeplisken42784 жыл бұрын
Love your style and sense of humor. Please make this into a full series with enemies' health, dialog, and more. god damit haha. Make a series that is a full game like Dark Souls maybe but keep up the excellent explanations, that is really helpful. The character can attack in the air at the moment, so maybe check isGrounded before allowing attacks? Like this maybe: private void Update() { Move(); if (Input.GetKeyDown(KeyCode.Mouse0)) { if (isGrounded) { StartCoroutine(Attack()); } } }
@keithfrechette80582 жыл бұрын
Why not attack in their air? How else could Gandalf have kept beating the crap out of the Balrog while they were falling? Surely you wouldn't say to Gandalf, "You cannot attack!" 🙂
@julesvilain48632 жыл бұрын
make a special strike down attack when not grounded
@NimbusTheSkyKid2 жыл бұрын
Amazing Tutorial. After 2 days going through other tutorials I was about to explode, they were either not explaining enough or too complex. I was about to give up and try to find a easy download script but I felt lame because I wanted to actually learn how to code it. This tutorial explained so much where I almost feel confident that I can add a dodge animation myself and code it. Thank you so much Merry Christmas
@devinjackson64372 жыл бұрын
Bro this was literally by far the best video I've found so far. You use barebones objects and get right to the point when explaining concepts. I appreciate you so f***kin much my guy
@SingleSapling2 жыл бұрын
:DD
@DiegoSynth Жыл бұрын
Each time my animations break, I need to find your video and you always fix them! You are the only one who shows how to properly do this. Thanks!
@Fanoflix3 жыл бұрын
Legendary video.I had 3-4 unique cases I was having problems with, and this one addressed them all. Thanks!
@mr.dingleberry48824 жыл бұрын
Lepo je videti da se ljudi sa nasih prostora bave game devom :D Samo napred, pozdrav iz Srbije
@SingleSapling4 жыл бұрын
Bas lepo, fala lipo :D
@e.l54903 жыл бұрын
Thank you so much. I could never find a tutorial like this to use animations, now I can finally use unity in peace.
@youknowtherulesandsodoi11263 жыл бұрын
After some problems and issues I FINALLY finished and I am so happy XD
@michaelrosenfeld80553 жыл бұрын
Thank you so much for this. I am one of those idiots who lacks patience to read through documentation until there is no other way. Awesome Job!
@SingleSapling3 жыл бұрын
:D
@clintonhawkins86662 жыл бұрын
I'll repeat what everybody else is saying, thank you so much. I have followed so many other tutorials and could not get the mask to work correctly without adding it to a separate layer. You saved me so much continued frustration.
@willholt63893 жыл бұрын
Great video. Right to the point AND actually uses a lot of the tools that Unity has to make things easier, unlike some. A+!
@SingleSapling3 жыл бұрын
Thanks :*
@deftartisan67694 жыл бұрын
We gotta maintain the Slavic bond as tight as possible. Nice vid.
@SingleSapling4 жыл бұрын
:D
@madlad24703 жыл бұрын
not gonna lie this is best video i ever seen its explain how to make nice movement for characters. ive seen many videos but this one is amazing one. KEEP IT UP
@SingleSapling3 жыл бұрын
@TakeOneCandy2 жыл бұрын
This is what I have been looking for a week. Thanks, u earned a Sub
@SingleSapling2 жыл бұрын
thanks
@rs92_2 жыл бұрын
Thanks. You maded the most clear unity tutorial i ever seen
@SingleSapling2 жыл бұрын
;)
@tigranziberov-mkrtchyan63759 ай бұрын
One of the best character controller explanation ,thanks a lot
@thomasgrill89833 жыл бұрын
Best video I have ever seen about character controllers. Charm Top Explanation Top Subscribed immediately
@SingleSapling3 жыл бұрын
@yanes6232 жыл бұрын
One of the most complete and easy to follow, animations tutorials, great work!
@sagarsuman1299 Жыл бұрын
Just loved it really explained so well couldn't resist commenting
@yakuplayk35324 жыл бұрын
Very good video and İntro is so good. :D
@NimbusTheSkyKid2 жыл бұрын
Here is the code if you want to move horizontal and vertical: float moveZ = Input.GetAxis("Vertical"); float moveX = Input.GetAxis("Horizontal"); moveDirection = new Vector3(moveX * moveSpeed, moveDirection.y, moveZ * moveSpeed); moveDirection = transform.TransformDirection(moveDirection); **Also I had to set the "move speed" to 1 in unity for this to work for some reason. Im a beginner so spent all day figuring this out, hope it helps someone out
@SingleSapling2 жыл бұрын
What doesnt work
@SingleSapling2 жыл бұрын
Let me see your code
@zhainhudan1566 Жыл бұрын
moveDirection.y = ?? please help me
@МолодаяТакса3 жыл бұрын
thank you man . your transform.TransformDirection function helped me a lot . i waisted time on a lot of tutorials but your is the one which helped
@MToryYT2 жыл бұрын
Thank you so much for the amazing video. There are plenty of great tutorials out there but this is so far the best. It was easy to apply the animation to my character controller script too.
@SingleSapling2 жыл бұрын
:}
@Coffeycup273 жыл бұрын
Just a tip, if your transform isn't showing at your player's feet when you select Player, hit Z.
@adrianeilsantos3 жыл бұрын
Thank you
@activemotionpictures3 жыл бұрын
Perfect!! Thank you!! This is what I was looking for.
@ollocksbay3 жыл бұрын
Brilliant, this was exactly what i needed to get started, thank you dude!
@stylie473joker53 жыл бұрын
glad it worked for you, for me none of the animations worked so i changed to getcomponent instead and now only idle animation worked other didn't any idea why its happening ?
@ollocksbay3 жыл бұрын
@@stylie473joker5 did you change the threshold? so the idle,walk,run is set to 0,0.5,1? cause if you're only left with the idle its possible the threshold is left at 0 and idle is st first? i have little to no experience apart from this tutorial video and some of brackeys
@bashtinator2 жыл бұрын
At the point whe he says: "Lets start with as simple private void start.... Heheeeeeeee good job right !?" Liked and Subed imediately lol
@mackmartin85613 жыл бұрын
Fantastic video. I was able to translate what I learned directly into animating another model and getting strafing into the controller as well! I'm working on sorting out that attack delay you mentioned, but I'm having a hard time figuring out a smooth way to delay that input, so if you tackle that in another tutorial I'd love to know! Thanks again for a great learning experience!
@SingleSapling3 жыл бұрын
Nice, glad I could help, maybe I should make a bit more of a advanced controller tutorial :]
@shortStories1973 жыл бұрын
could you please tell me about jump animation, i am doing it but on doing so character is moving out of the character controller cylinder which is obviously creating issues please help if you know
@SingleSapling3 жыл бұрын
U need to attach colliders to the bones
@6fukraken Жыл бұрын
The best tutorial i have seen. Thank you!
@MAx2L4eva3 жыл бұрын
i love your tutorial and the way you do insults , 10/10
@SingleSapling3 жыл бұрын
Hhahaha thanks
@yoketown2 жыл бұрын
Took me 8 Hours today nice, just need to find a fix on how not to lose speed while jumping for nice sprint jumps.
@yeeyee_anime3 жыл бұрын
the only thing i get excited for now is a good teacher on youtube and this tutorial is real great way better than ur other one.
@TheRealWilliam5202 жыл бұрын
I'm having some problems after I put in the ground code section. The "Is Grounded" check box won't turn on when I make contact with the ground and my character moves slow. I thought I had to be patient when I got to the jump command but it turns out I can't jump either. And before you say anything, yes. I went back and watched it about 5 times already. Can I have some help please?
@knp37153 жыл бұрын
Thanks man this was what i been searching for, for months u did gud
@jeanmauricev3 жыл бұрын
The only tutorial that worked nice job!
@masumhossain28363 жыл бұрын
One of my best tutorial as a beginner
@GLORIA-iv4ij10 ай бұрын
This is the best guide ever, thank you so much for this
@tawfiqkhan-bf5lg Жыл бұрын
Alhamdullah ,bro. i learn many thing from your video
@mlgfrog24703 жыл бұрын
Oh shit didn't know you made an update! Thank you very much kind sir!
@papadumas6689 Жыл бұрын
Very well done. This is what I have been looking for. Thanks!
@mistakoruto3 жыл бұрын
Adding Attack Animation - Save my life.
@touqan50913 жыл бұрын
I figured it out btw amazing tutorial keep up the good work my dude.
@iOriyrdi2 жыл бұрын
Finaly,i didnt know how to move and attack without that Goofy slide,thank you
@thuongtrinh93643 жыл бұрын
Thank you so much man, this tutorial is amazing
@Siddhantmane034 жыл бұрын
THANKS MAN ITS REALLY HELP!
@SingleSapling4 жыл бұрын
:*
@avanishpatitripathi15623 жыл бұрын
I love this... I wish more tutorials were like this...
@SingleSapling3 жыл бұрын
;)
@erngkmn3 жыл бұрын
Clear explanation I ever seen.
@Capellofficial4 жыл бұрын
OH MY GOD! SO USING PLAYER MASK SAVES TIME IF YOU WANT TO EX: CROUCH ATTACK, PRONE ATTACK ETC. THATS HOW GAME DEVS SAVE TIME ON ANIMATING EVERY LITTLE DETAIL! Ahem... Sorry. You just blew my mind! You got my sub!
@victor11023 жыл бұрын
This is epic, thank you and keep up the goodies, cheers!
@victor11023 жыл бұрын
Btw, superb clear explanation, really a job well done, thank god I found your channel!
@michaelwilson84613 жыл бұрын
Nice , simple and straight forward. Thanks man.
@jenrin8534 жыл бұрын
Thanks for this tutorial, you are so amazing, thats what ı've looking for three days.
@SingleSapling4 жыл бұрын
Thanks my dude. Hmmm, is it a warning or a error(red or yellow)?
@jenrin8534 жыл бұрын
@@SingleSapling fixed it already but ı just want to simply ask , ı am using that code (Vector3 moveDirection = transform.forward * moveZ;) instead (moveDirection = new Vector3 (0 ,0, moveZ)), because when ı use your code my character is going only one direction , not following the looking way ( ı mean face way) but if ı use my code instead it, its going anyway what ı want ( when rotate it with the mouse ofc), is that would be a problem with animations?
@jenrin8534 жыл бұрын
because my animations dont work.
@SingleSapling4 жыл бұрын
That shouldnt be a problem for the animations, how exactly do they not work( do they not show up or?....)
@jenrin8534 жыл бұрын
@@SingleSapling Idle is working but the rest are not working, when ı press w its moving but not animating, ı did everything right,ı believe same as your video.
@ArtOfMkUltra3 жыл бұрын
As a non coder this tutorial is really helpful
@SABaruj3 жыл бұрын
Finally! after 3 days its finished, i learned something yes but i undo the last attack animation fix because to me, it looked better before that fix
@mohammedabdo81473 жыл бұрын
Bro your Explaining is very Good ❤
@stelcxantisto3 жыл бұрын
You save my day, I love you.
@akashtechdeveloper3 жыл бұрын
for camera controller we use cinemachine insted of script
@YA-vl8jh3 жыл бұрын
Very well made and explained 👌
@KousseilaMd Жыл бұрын
ur the perfect guys at the perfect time, bro great video keep up
@CollapseDev3 жыл бұрын
For anyome wondewring the part at the end to control and let an animation finish can be better done as an "animation behaviour" in mecanim. There you create a new script to access the on state exit and in that state you turn off your bool which would cause it to play that animation or change the state at animation end-these will allow you to play with time and allow animations to start and end properly so from there you just tweak usual transition settings to get it just perfect.
@abdullahyaqoob48962 жыл бұрын
Dude you are literally perfect .. dont say that i stole this from someone. Brackeys is also good though.
@SingleSapling2 жыл бұрын
:D
@matthewbergman68032 жыл бұрын
Can you alter the rotation and size of the character controller? I’m using a rigidbody because I want my character’s collider to align with their body when they roll (so they can roll under obstacles).
@LORD---BrazilianSoldier2 жыл бұрын
Worked perfectly, youre amazing, thank you so much soldier
@NimbusTheSkyKid2 жыл бұрын
Great tutorial so far. For some reason during 26:24 once I placed the walk, run, idle, jump codes under "If (isGrounded)" I couldnt run using shift or jump using space. Ended up leaving it out of the IsGrounded brackets and was able to run and jump. Any solutions?
@Darkziss02 жыл бұрын
Same
@RandomSZ2 жыл бұрын
thank you this really helped out a lot :) if anyone else needs help the code is: if(isGrounded) { } if(moveDirection != Vector3.zero && !Input.GetKey(KeyCode.LeftShift)) { Walk(); } else if(moveDirection != Vector3.zero && Input.GetKey(KeyCode.LeftShift)) { Run(); } else if(moveDirection == Vector3.zero) { Idle(); } moveDirection *= moveSpeed; if(Input.GetKeyDown(KeyCode.Space)) { Jump(); }
@quinc78142 жыл бұрын
I got this problem too, but I fixed it by realizing I didn't set the "Ground Mask" to "Gound". check out 23:46 Not sure if this solved your problem, but I hope this helps.
@eddyperera67803 жыл бұрын
I love the tutorial. Thanks a lot!
@xongram31394 жыл бұрын
Helped me a lot with animation....Thank You so much
@Brainyplanet4 жыл бұрын
My pivot stays on centre after dragging a character into Player object, what I do pls help! *Update* I found solution on forum: at the top on Pivot setting, it will be Centre and Local. Click on Centre and change it to Pivot and it will fix.
@Aye_Sid3 жыл бұрын
Thanks brother.. 😀👍🏻
@Brainyplanet3 жыл бұрын
@@Aye_Sid :-)
@dmars4443 жыл бұрын
The jumping was a bit off, good for basic tutorial i guess but halting all movement while youre in the air feels unnatural in a game world. not a perfect solution but moving " moveDirection *= moveSpeed; " back out of the if(isGrounded) check means you can move while in the air. I tested just maintaining current forward velocity when you jump aswell but that feels way too rigid for a game even though that is the most realistic thing. If thats the results you want though the quick and dirty is to put " moveDirection = new Vector3(0, 0, moveZ); moveDirection = transform.TransformDirection(moveDirection); " these two lines into your if(isGrounded) check. I am a noob like the rest of us and wrote this quickly, if anyone can improve feel free. All that being said thanks very much for taking the time to make this guide, very easy to follow along with and concepts were explained to a decent level to get a solid understanding of the core concept without boring with too much unnecessary detail for a tutorial of this complexity.
@takjegal84733 жыл бұрын
This works for me thank you!
@amanpreetchander73863 жыл бұрын
One of the best tutorial indeed. Thank you so much !!! This really helped !!!!!!!
@SingleSapling3 жыл бұрын
@Aye_Sid3 жыл бұрын
Thanks brother u r awesome. I didn't know anything about Unity and now I learn how to control a character. 😇🙏🏻
@melihcanozdemir73093 жыл бұрын
42:33 That's what i am searching about. Thank you bro
@iggy6662 жыл бұрын
Everything works well, thank you very much for the tutorial!
@cloudverbal6736 Жыл бұрын
Sir, excellent tutorial! Thank you very much
@SingleSapling Жыл бұрын
Thank you my dear sir
@wongjackson33458 ай бұрын
i can't believe that i just sit there and watch the whole video
@pequeno3d3 жыл бұрын
Clear and clean 🙏👍
@SingleSapling3 жыл бұрын
Thanks
@dmars4443 жыл бұрын
Also Sapling, when i watch these types of videos i manually write out the code step by step to get a firm understanding, if you were to supply your code it would make error checking 1000x easier because I could paste your code in and see if my jumps were performing the same as yours. This would mean that I have the code correct and that something else was causing me problems. Just a useful tool for fault finding, I ended up visiting Brackeys and the unity help documents and testing their code aswell and got the same weird mini pause at the top of my jump so either its meant to be like that or something wrong with a setting somewhere. kinda like velocity keeps trying to push my character upwards but he has hit his head on a roof, then once gravity takes over he starts falling. Couldnt really see if your character was doing it, any input/thought would be great.
@T8BB3 жыл бұрын
I did everything but the character can't run or jump and the animation is not clean wow ty
@ssgamer5705 Жыл бұрын
Hi simple saplings i love your code it's so much clean not like other people but there is a problem that my character is merging into the ground i try to make some change in value but it did not work do you have any solution
@betray10772 жыл бұрын
at 24:26 character just falls through ground what can i do?
@betray10772 жыл бұрын
oh putting height to 2 in the character controller worked probably because I'm trying it with different character, but it's still lagging and walkspeed is really slow probably need to increase those as well anyway great tutorial man keep it up!
@betray10772 жыл бұрын
oh now jumping doesn't work anymore pls
@betray10772 жыл бұрын
oh increasing characters y position in transform worked lol
@betray10772 жыл бұрын
i completed idle walking and running animations but it does animation once and freezes any advice
@betray10772 жыл бұрын
and also character im using says none avatar on animator
@nasossg3 жыл бұрын
You deserve all the likes in the world
@edanurkulac26603 жыл бұрын
Thank you so much man. Very great video.
@psychTech3213 жыл бұрын
The isGrounded boolean value is not getting enabled whenever the character is touching the ground any soultions???pls help
@SingleSapling3 жыл бұрын
Please watch the WHOLE video and then let me know
@arbazjaved8664 Жыл бұрын
Bro that is very helpful thank you for this❤️
@henrypowell34963 жыл бұрын
best video on character movement with animation
@hazel_yd3 жыл бұрын
Perfect explaining :)))))))) Thanks a lotssss
@trigmax4 жыл бұрын
Oh thank you. this is best. tutorial
@safdardeveloper38042 жыл бұрын
You deserve the like only because of your humour! very funny while learning.
@SingleSapling2 жыл бұрын
:*
@akiraharumi2892 жыл бұрын
its late 2022 and it's still very helpful, great vid!!
@SingleSapling2 жыл бұрын
That was the goal :]
@akiraharumi2892 жыл бұрын
@@SingleSapling I'm new to game dev and I found your channel to be the most awesome, helpful and newbie friendly 🥺
@SingleSapling2 жыл бұрын
Welcome to the club, thanks
@SAR0CKX3 жыл бұрын
Thanks a bunch, dude! you are amazing and funny :) I look forward to more gifts!
@ciphergrind41822 жыл бұрын
Great tutorial! Thank you!
@MehmetSarkd4 жыл бұрын
Thank you so much!
@ItsShazOne4 жыл бұрын
40:57 how to add multiple attack animation and play it when we click the left mouse button multiple times???
@rdev37203 жыл бұрын
So you can create a float(number) in the animator and do something like this public int random; 1st function. anim.setfloat("your float name", 0); 2nd function anim.setfloat("your float name", 1); 3rd function anim.setfloat("your float name", 2); in your void start say void start random = Random.Range(0,2)//it can be -1 ,3 so if 0,2 doesn't work just try -1,3 if(random == 0){ 1st function(); random = Random.Range(0,2) } and then repeat the last if statement twice. its not really effective but it works so hope it helped
@kushal5683 жыл бұрын
@@rdev3720 Wait can explain this again it's a bit confusing.
@rdev37203 жыл бұрын
@@kushal568 so basically when you attack the game generates a number from 0-2 and the 3 animations stand for the each number. So after you attack your next attack animation will be according to the number generated last time. Hope it helps
@kushal5683 жыл бұрын
@@rdev3720 I am a bit confused on the code, could you explain it again and like what do I even do?
@kushal5683 жыл бұрын
@@rdev3720 Nvm I got it, but do you know how to make it so the same attack animation doesn't play two times in a row.
@arooly3 жыл бұрын
Thank you, the tutorial is very good.
@SingleSapling3 жыл бұрын
:*
@gamegun76933 жыл бұрын
Yoo thanks because of you i can now make a animated 3rd person Character