@@TheKiwiCoder Help!!! My Character Controller is having issue with isGrounded, The character is on the ground but still it is Debugging isGrounded (False).
Thank you so much! Helped me out alot. I was switching from a rigidbody to a CharacterController in order to climb stairs. Since you included jumping in this video, my character is now finally able to properly jump too :D
Anyone using Unity's "Auto Cam" from Standard Assets to follow his Character, and having jerky movement: You need to set Auto Cam's cycle to "Late Update" and in this code, instead of "FixedUpdate" as shown by Kiwi, rename it to "LateUpdate" (everything else exactly the same). Then you can leave Animator to "Normal" and have smooth Character animations (while moving) again.
Wow!! I just did finish your 1-10 series yesterday, then saw this pop up today! It's exactly what I was looking for next, thank you! Really appreciate the time you've put into these tutorials. I've been working in Unity about 1 year, but focused on 2D until now. I have a fairly strong background in coding, but all the rigging knowledge that 3D requires created a huge barrier. I'm not even trying to make an FPS game, but this series helped me learn so much. Thank you again!
@TheKiwiCoder, just dropping you a note to say "thanks" 3-years after you posted this. I recently moved over to using root motion (as I have some pretty good animation assets (thanks Explosive)), and while I understood the core concepts of using root motion and a CharacterController, something about the way that you explained it cleared up a lot of fuzz for me, so I felt that I should drop you an appreciation comment.🖖
@TheKiwiCoder Excellent! I started at one a couple of days back and finished this today. I am super impressed you amazingly salvaged the standard Unity Character Controller. I am confident I can use it as well now ^_^b Btw when it comes to colliding with boxes and stuff, I would recommend using a rigidbody with Is Kinematic set to true. I think this allows you to interact with boxes and stuff like normal rigid bodies would except a few things like drag and gravity will not work. So combining the two sounds like a nicer way to do it. Very usecase dependent scenario though. I love what you've done here mate. Thanks! I really appreciate the fact that you're teaching people to do things the vanilla way without having to jump into buying third party assets.
Thanks for the tips! I will give that a try. Yep I’m trying to show how everything can be done from scratch. I find it helps to understand third party assets too :)
Hi Kiwi. AWESOME tutorial! Info on animated Character Controllers with root motion is so sparse, this really helped! I previously stuck with Rigidbody + root motion implementation and my own code for step-offset and sphercast-check for isGrounded. But it was still very clunky and constantly had issues. With your video, I was finally able to revert back to Character Controller. Thanks so much!
make a video at 1000 subscriber milestones about yourself(becoming game dev), your achievements, how do you manage time to create these tutorials, and what's coming next!
This might be covered in another video, but if you want the decals to stay on the object they hit, change your hitEffect code like so: hitEffect.transform.SetParent(hitInfo.collider.transform); hitEffect.transform.localPosition = hitInfo.collider.transform.InverseTransformPoint(hitInfo.point); hitEffect.transform.forward = hitInfo.normal; hitEffect.Emit(1); And then make sure the Simulation Space for the Decal's Particle System is set to 'local'
@@TheKiwiCoder I'm not, but I could be doing it wrong 🤔 hitEffect.transform.SetParent(hitInfo.collider.transform); hitEffect.transform.localPosition = hitInfo.collider.transform.InverseTransformPoint(hitInfo.point); hitEffect.transform.forward = hitInfo.normal; hitEffect.Emit(1);
plz help it stutters even tho im in Normal mode in the animator! and when i go into animate Physics it dosnt stutter anymore but i cant use my other animations anymore like swap
I jut moved the Cinemachine brain on the main camera blend update method to Late Update. The Character Animator was left at Normal update. No jittering.
Video suggestion: Sword swings using the animation rigging package, for example the sword first swings towards the last mouse direction and then goes towards the center of the screen. Do you think it's possible?
Hello, if it's possible could you please help me to understand the reason for your jerky char movement problem. Your root animator controller update mode was normal, riglayer controller was also at the same mode. so is it because of the CharacterController component of unity that we have to use motion codes in fixed update () ? and its not match with rootmotion moves? Kind Regards
sir can you make wall running just like the flash do plz sir can you make a tutorial on this i mean character controller wall running or wall climbing plz
check that you cache CharacterController into your variable at start and that it is found before you call Move() on it. Maybe put in a Debug.Log, or make the field public temporarily, so you can see if it works.
Really good series. I have come across an issue, when using root motion. I have it so that the character rotates in direction pressed, and rotates in direction camera is facing. When applying the root motion as you have the character no longer wants to rotate(camera facing rotation still works.) It works without rootmotion. Any ideas on what i can do?
@@TheKiwiCoder Hi thanks for the response. No that was the issue, the rotation was done via code. I imported animation to blender and rotated then exported and it was working after. I miss understood how exactly root motion works.
@@TheKiwiCoder I found the most reliable network solution on the internet is a custom dedicated server by Tom Weiland. he is currently making pirate-themed multiplayer games. he made a networking tutorial series, within part 4 he completed almost all the core of C# networking. if u both collaborate and help us show how to implement his network solution to a third-person shooter game this would be awesome! his channel link: ua-cam.com/channels/a-mDKzV5MW_BXjSDRqqHUw.html
you can also go with PUN 2 or mirror but I don't think so this is good option if we plan to release our game. PUN only support 20 (maybe ) CCU for free.
The Creativity Thanks for the info I’ll check it out. I have some experience using forge, mirror sounds interesting too. 20ccu isn’t really going to help anyone..
@@TheKiwiCoder I was actually able to get networking done with mirror...bit of work... but all working with authoritative movement and fire/aim and client side prediction
@@TheKiwiCoder Actually I found out it was because I added a layee in the animator with nothing and it has a default weight of 0. For some reason it overwrited the other layer ^^
I followed the steps through, everything seems to be working. But the jump animation keeps being played when the character isn’t jumping, in the animator it’s spamming back and forth from the walking state to the jumping state transitions. Could it be that the jump animation I’m using? Because it’s just pose and not an animation.
What if you were to keep using the Rigidbody instead of Character Controller since I personally like the physics, present in the rigidbody, more. I tried changing the lines from character controller like: cc.Move(stepForwardAmount + stepDownAmount) to rigidbody.velocity = stepForwardAmount + stepDownAmount but it didn't work.
@@TheKiwiCoder Yeah I just though it would be cool if you could go up against a wall, crouch behind it, peak out and maybe peak over and come back into couver
Hi there, thanks again for the video. It doesn't look like you're having problems with CharacterController.isGrounded, but I'm having loads of issues with it. Whenever my player is walking down any kind of hill, isGrounded goes to "false" even with gravity applied, and with Min Move Distance set to 0. Have you switched to a different way of detecting if your character is grounded? Or is the built in function still working fine for you?
Yep I'm still using this approach. Haven't made any significant changes there. Double check 'Min Move Distance' is set to 0 on the character controller component. And make sure to read the 'isGrounded' value immediately after calling cc.Move, as that's the only time it's truly valid.
Hey, i'm doing a game with similar movement than yours, the basic movementation is basically the same (walk, jump, gravity calculation, etc), but i have a hookshot mecanic that use Vector3.MoveTowards do make the player go to the position i shoot, and sometimes when i use it and cancel the path in middle air the player falls really fast, can you tell me in which part of the script i can solve this problem? I'm not that good with physics yet and i'm struggling a little, but i suppose this is something in the velocity.y;
Hey, it could be the step down part, that should only be run when the player is grounded. Or perhaps the velocity.y needs to be reset to zero when you cancel.
@@TheKiwiCoder Sorry for the late answer, i made a pause in the development but now i'm getting back with the programming. I changed the hookshot movement to the CharacterController.Move, but still had no luck changing the code, i was pretty sure that the problem was in the velocity.y but i tried reseting in every part of the code and the character still fall too fast, i'll try again in the next days, i hope i'm not being so dumb xD I need to make a deep study about how to deal with Physics, thats the first time i use rootMotion to move my Character. And thanks for the response :D
Kia ora bro, good to see a kiwi developer, Im trying to develop a simple game and have been using unity, very complex, are you able to help, the game i want to develop has not been done yet is a very popular activity.
Hello, how are you? I'm writing to you from Argentina, I'm new to unity, I'll tell you, I'm making a 2D game, the character walks, runs and what I want to do, it's something similar to what you do in this video, that while walking, turn on A flashlight, that is to say that only the arms are encouraged while walking, this is possible, as someone who is walking and without stopping to walk, turn on the flashlight and encourage his arms without stopping walking. I would really appreciate if you can guide me a bit. From already thank you very much! Excellent game you are developing! Cheers!
One of the most valuable Unity tutorial series I have ever seen on UA-cam, keep it up!
Thank you so much 😊
@@TheKiwiCoder Help!!! My Character Controller is having issue with isGrounded, The character is on the ground but still it is Debugging isGrounded (False).
@@farrukhmalik8747 same with me it's value changing true to false and false to true constantly
One of the most truest statements on UA-cam
,@@farrukhmalik8747 I
RECOMMEND YOU WATCH IHeartGameDev's video on jumping he got the same result as you and told us how to fix:)
Thank you so much! Helped me out alot. I was switching from a rigidbody to a CharacterController in order to climb stairs. Since you included jumping in this video, my character is now finally able to properly jump too :D
Anyone using Unity's "Auto Cam" from Standard Assets to follow his Character, and having jerky movement: You need to set Auto Cam's cycle to "Late Update" and in this code, instead of "FixedUpdate" as shown by Kiwi, rename it to "LateUpdate" (everything else exactly the same). Then you can leave Animator to "Normal" and have smooth Character animations (while moving) again.
I thought the series ended with the last video with title 10/10. Was super happy to see 11/11 :)
Haha, I don’t have an end, so look out for 167/167 lol
@@TheKiwiCoder then probably it's better to remove the /11 or whatever.
Great serie btw
Ah you might be right! Cheers :)
Wow!! I just did finish your 1-10 series yesterday, then saw this pop up today! It's exactly what I was looking for next, thank you!
Really appreciate the time you've put into these tutorials. I've been working in Unity about 1 year, but focused on 2D until now. I have a fairly strong background in coding, but all the rigging knowledge that 3D requires created a huge barrier. I'm not even trying to make an FPS game, but this series helped me learn so much. Thank you again!
That’s great to hear, glad you’re finding them useful.
@TheKiwiCoder, just dropping you a note to say "thanks" 3-years after you posted this. I recently moved over to using root motion (as I have some pretty good animation assets (thanks Explosive)), and while I understood the core concepts of using root motion and a CharacterController, something about the way that you explained it cleared up a lot of fuzz for me, so I felt that I should drop you an appreciation comment.🖖
Thank you Brian! Root motion is very topical in games. It’s a trade off between quality vs responsiveness.
@TheKiwiCoder Excellent! I started at one a couple of days back and finished this today. I am super impressed you amazingly salvaged the standard Unity Character Controller. I am confident I can use it as well now ^_^b Btw when it comes to colliding with boxes and stuff, I would recommend using a rigidbody with Is Kinematic set to true. I think this allows you to interact with boxes and stuff like normal rigid bodies would except a few things like drag and gravity will not work. So combining the two sounds like a nicer way to do it. Very usecase dependent scenario though. I love what you've done here mate. Thanks!
I really appreciate the fact that you're teaching people to do things the vanilla way without having to jump into buying third party assets.
Thanks for the tips! I will give that a try. Yep I’m trying to show how everything can be done from scratch. I find it helps to understand third party assets too :)
Hi Kiwi. AWESOME tutorial! Info on animated Character Controllers with root motion is so sparse, this really helped! I previously stuck with Rigidbody + root motion implementation and my own code for step-offset and sphercast-check for isGrounded. But it was still very clunky and constantly had issues. With your video, I was finally able to revert back to Character Controller. Thanks so much!
Help!!! My Character Controller is having issue with isGrounded, The character is on the ground but still it is Debugging isGrounded (False)
This video is a gold mine -- thanks so much.
This series are gold. Great job man!
These tutorials are worthy. Please keep making the vidoes. It's totally worth of time.
Thanks man, it does take some time for sure. More videos to come stay tuned!
@@TheKiwiCoder 💯💯💯
I m having this feeling that this series gonna be 100/100
Man you test our patience a lot but definitely it is gold 😉
I wish. It's totally worth to watch the videos.
Thanks for your patience🙏
@@TheKiwiCoder waiting for advance AI, and some cool missions, something like rise to honor or Lara craft
I love this tutorial series, if you’re looking to continue this series at all, could you please do sprinting and crouching/rolling.
It’s on the list!
*me on episode 7* mannnn only 3 more videos left.
*sees 7/11* waaaaaaaaaaaaat.
Thank you. I'm learning so much from you.
Good luck!
Really good tutorial. Helped me get my head around loads of stuff. You're not over the top like most UA-camrs and seem down to earth! *SUBSCRIBED*
This is another great video, thank you. The code is simply elegant. ☺
best unity tutorial by anyone in utube tq keep it up
love your videos, sharp and clear, keep up the good work!
Yep, this one helped me a lot! Just what I needed to get my small project going forward. Thx and keep it up!
meele weapon please!
Thankyou 🙏🏻 I’ve waited for this
Cheers, Good luck!
make a video at 1000 subscriber milestones about yourself(becoming game dev), your achievements, how do you manage time to create these tutorials, and what's coming next!
This has got me thinking. Thank you for the suggestion!
You could use a repo to make it easier for us to access the code. You can make it available on GitHub, for example.
Você aqui? Kkk
@@MASTONGAMES sim, o canal desse cara é muito foda. Tô aprendendo várias parada
@@HighLevelGames pena que o tutorial nao foi feito per você, pois seria bem mais fácil de entender 😄
Help!!! My Character Controller is having issue with isGrounded, The character is on the ground but still it is Debugging isGrounded (False).
There is an alternative method where you create your own ‘isGrounded’ check by using Physics.OverlapSphere at the base of the character.
@@TheKiwiCoder ThankYou
@@farrukhmalik8747 same problem .are you find a soulution?
This might be covered in another video, but if you want the decals to stay on the object they hit, change your hitEffect code like so:
hitEffect.transform.SetParent(hitInfo.collider.transform);
hitEffect.transform.localPosition = hitInfo.collider.transform.InverseTransformPoint(hitInfo.point);
hitEffect.transform.forward = hitInfo.normal;
hitEffect.Emit(1);
And then make sure the Simulation Space for the Decal's Particle System is set to 'local'
Interesting. I think hitEffect also needs to be instanced for each new object hit. Or does this actually add the particle as a child?
@@TheKiwiCoder I'm not, but I could be doing it wrong 🤔
hitEffect.transform.SetParent(hitInfo.collider.transform);
hitEffect.transform.localPosition = hitInfo.collider.transform.InverseTransformPoint(hitInfo.point);
hitEffect.transform.forward = hitInfo.normal;
hitEffect.Emit(1);
plz help it stutters even tho im in Normal mode in the animator!
and when i go into animate Physics it dosnt stutter anymore but i cant use my other animations anymore like swap
Did you find a solution?
DId the same but i got a stuttering when i do moving + rotation at the same time. Not the Player Stutters but the Object in the World.
I jut moved the Cinemachine brain on the main camera blend update method to Late Update. The Character Animator was left at Normal update. No jittering.
I loved the video thanks:) but can you add a health and damage system as well as a sprinting system. Thanks
Both of them are definitely topics I’ll try to cover soon.
Best youtube tutorial, no doubt! One question: does the characterController work together with the animation's rootMotion?
well it depends, weather you want animator update mode to normal or animate physics.
@@psycodestudio thanks
thank you greate tutorial video.
I'll try this!
How to remove jaggy movement when we climp up stairs ??
Try adding some vertical damping to cinemachine
@@TheKiwiCoder i am using unity standard assets camera scrpt !
Video suggestion:
Sword swings using the animation rigging package, for example the sword first swings towards the last mouse direction and then goes towards the center of the screen.
Do you think it's possible?
It sounds possible at least.
very good tutorial, can the weapons be dropped? or they can only be put together and exchanged for another. regards
Not yet, id approach it the same way as reloading, or just make them disappear.
Hello, if it's possible could you please help me to understand the reason for your jerky char movement problem. Your root animator controller update mode was normal, riglayer controller was also at the same mode. so is it because of the CharacterController component of unity that we have to use motion codes in fixed update () ? and its not match with rootmotion moves?
Kind Regards
wow best videos
Again, Awesome!!! can you go for crawling ? plz plz plz.....
Ah like battlefield style. Interesting topic, added to the list :)
sir can you make wall running just like the flash do plz sir can you make a tutorial on this i mean character controller wall running or wall climbing plz
I hope so!
cool tutorial, but i have a problem where my character controller wont move anymore while animations still playing ? anyone ideas ?
check that you cache CharacterController into your variable at start and that it is found before you call Move() on it. Maybe put in a Debug.Log, or make the field public temporarily, so you can see if it works.
Broooo where have you been ....if I've seen your tutorial 3-4 years ago I could have been working in EA or ubisoft
Hahah. There's still time!!
Lmao
This is awesome dude,you just created Fortnite in a short time
Shipit
Thank you for this awesome tutorial
Really good series. I have come across an issue, when using root motion. I have it so that the character rotates in direction pressed, and rotates in direction camera is facing. When applying the root motion as you have the character no longer wants to rotate(camera facing rotation still works.) It works without rootmotion. Any ideas on what i can do?
Is that rotation coming from the animation? If so, you might need to incorporate animator.deltaRotation too.
@@TheKiwiCoder Hi thanks for the response. No that was the issue, the rotation was done via code. I imported animation to blender and rotated then exported and it was working after. I miss understood how exactly root motion works.
now can u dive into multiplayer? cant wait! and please try to upload videos weekly basis if possible
Do you have a preferred network library?
@@TheKiwiCoder I found the most reliable network solution on the internet is a custom dedicated server by Tom Weiland. he is currently making pirate-themed multiplayer games. he made a networking tutorial series, within part 4 he completed almost all the core of C# networking. if u both collaborate and help us show how to implement his network solution to a third-person shooter game this would be awesome! his channel link: ua-cam.com/channels/a-mDKzV5MW_BXjSDRqqHUw.html
you can also go with PUN 2 or mirror but I don't think so this is good option if we plan to release our game. PUN only support 20 (maybe ) CCU for free.
The Creativity Thanks for the info I’ll check it out. I have some experience using forge, mirror sounds interesting too. 20ccu isn’t really going to help anyone..
@@TheKiwiCoder I was actually able to get networking done with mirror...bit of work... but all working with authoritative movement and fire/aim and client side prediction
Hello, my rigs weights go down to 0 while playing some animations, I don't know what's happening since I don't touch them in scripts. Any idea ?
It could be one of your animation states writing default values. Try changing the default scene value to 1
@@TheKiwiCoder Actually I found out it was because I added a layee in the animator with nothing and it has a default weight of 0. For some reason it overwrited the other layer ^^
I followed the steps through, everything seems to be working. But the jump animation keeps being played when the character isn’t jumping, in the animator it’s spamming back and forth from the walking state to the jumping state transitions. Could it be that the jump animation I’m using? Because it’s just pose and not an animation.
The code is exactly the same and the animator too.
Be careful about hasExitTime properties and the exitTime values, it should work then
Whenever I fall off a ledge I automatically jump, how would i remove this behavior?
@Steamsy can i ask you
My Character Controller is having issue with isGrounded, The character is on the ground but still it is Debugging isGrounded (False).help plz
Can we get this jump animatons ?
github.com/Unity-Technologies/Standard-Assets-Characters/blob/master/Assets/_Standard%20Assets/Characters/Animation/Male/Animations/Aerial/Jump/RunningJump/m@RunForwardsJump_Frame01.fbx
@@TheKiwiCoder thanks man 🤘
What if you were to keep using the Rigidbody instead of Character Controller since I personally like the physics, present in the rigidbody, more.
I tried changing the lines from character controller like: cc.Move(stepForwardAmount + stepDownAmount) to rigidbody.velocity = stepForwardAmount + stepDownAmount but it didn't work.
cc.Move doesn't do the same as rigidbody.velocity so thats where you went wrong
@TheKiwiCoder Please make a video on Npc Ai and make your project downloadable. I have some very weird problems while following your videos.
Dam very helpful video can you do crouching and a cover system to?
All I have is a character right now lol. There’s nothing to take cover from.
@@TheKiwiCoder you could make it online?
@@TheKiwiCoder Yeah I just though it would be cool if you could go up against a wall, crouch behind it, peak out and maybe peak over and come back into couver
clean
Wow! Thank you :)
why not leave at least one print of the script so we can compare
are you phantasy from cod4?
Hi there, thanks again for the video. It doesn't look like you're having problems with CharacterController.isGrounded, but I'm having loads of issues with it. Whenever my player is walking down any kind of hill, isGrounded goes to "false" even with gravity applied, and with Min Move Distance set to 0.
Have you switched to a different way of detecting if your character is grounded? Or is the built in function still working fine for you?
Yep I'm still using this approach. Haven't made any significant changes there. Double check 'Min Move Distance' is set to 0 on the character controller component. And make sure to read the 'isGrounded' value immediately after calling cc.Move, as that's the only time it's truly valid.
can u add a open treasure chest in the game plssssssssssssssss
Hey, i'm doing a game with similar movement than yours, the basic movementation is basically the same (walk, jump, gravity calculation, etc), but i have a hookshot mecanic that use Vector3.MoveTowards do make the player go to the position i shoot, and sometimes when i use it and cancel the path in middle air the player falls really fast, can you tell me in which part of the script i can solve this problem? I'm not that good with physics yet and i'm struggling a little, but i suppose this is something in the velocity.y;
Hey, it could be the step down part, that should only be run when the player is grounded. Or perhaps the velocity.y needs to be reset to zero when you cancel.
@@TheKiwiCoder Sorry for the late answer, i made a pause in the development but now i'm getting back with the programming. I changed the hookshot movement to the CharacterController.Move, but still had no luck changing the code, i was pretty sure that the problem was in the velocity.y but i tried reseting in every part of the code and the character still fall too fast, i'll try again in the next days, i hope i'm not being so dumb xD
I need to make a deep study about how to deal with Physics, thats the first time i use rootMotion to move my Character.
And thanks for the response :D
Kia ora bro, good to see a kiwi developer, Im trying to develop a simple game and have been using unity, very complex, are you able to help, the game i want to develop has not been done yet is a very popular activity.
Kia ora mate. You can join the discord server, there’s many people there who can help :)
Nice
Hello, how are you? I'm writing to you from Argentina, I'm new to unity, I'll tell you, I'm making a 2D game, the character walks, runs and what I want to do, it's something similar to what you do in this video, that while walking, turn on A flashlight, that is to say that only the arms are encouraged while walking, this is possible, as someone who is walking and without stopping to walk, turn on the flashlight and encourage his arms without stopping walking. I would really appreciate if you can guide me a bit. From already thank you very much! Excellent game you are developing! Cheers!
Hey there 👋 If you can join the discord server it might be easier to help there.
Can u make video about creating shop and shop menu in other scene and purchase happened in other scene plzzz..
Yeah man, added to the list :)
@@TheKiwiCoder thanks man your work is awesome 😙😙 plzz try to create character shop. I subscribed I hope video comes soon😊😊
I really want to do a character select screen at some point. I’ll make it a separate scene to illustrate how to pass data between them
@@TheKiwiCoder I can't wait for that tutorial Thanks so much😁😁😊😊
this is awesome but why root motion?
It looks better imo. Totally optional though. This gives a nice middle ground.
@@TheKiwiCoder i was traying the character controller without root motion and the player wont move no luck :(
Come Back BRRROOOO!!!!!!!!!
Where is the Rig Builder Component?
It’s part of the animation rigging package.
Make more tutorials please
Please Make a Sprinting system like PUBG mobile...
Yes Please.....
❤
❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤