If anyone wants to make it so that the diagonal speed is the same as the horizontal and vertical speeds, make sure to normalize the movement vector in the GroundMovement() function, so: Vector3 move = new Vector3(turnInput, 0, moveInput).normalized; . Also if you notice that there is a sliding/smoothing effect to your character after normalizing the movement vector, all you have to do is GetAxisRaw instead of GetAxis in the InputManagement() function.
Everything was working until 6:50, unity says that the forward in camera.forward isn't defined (sorry if this is simple, I just started using c#/unity) Do you have any solutions?
Hey guys if you found that your charactercontroller.isgrounded is not stable. make sure that the verticalvelocity when being grounded is less than 0. You could write just -1 or maybe something like verticalVelocity = -gravity * 0.1f;
great tutorial! I am having an issue though where the sprintSpeed is also effecting the jumpHight. when I press left shift I can run faster but I also jump higher even when im standing still. is this supposed to happen? if not how do i fix it?
in Unity 6 preview, when you change in GroundMovement the move.y value to anything else than 0 the character tip over, stopping the possibility to jump, do you have a fix for that please?
I have a question. So you said you will use kinematic approach and use Character controller component. So what's the difference if we use character controller component or Rigidbody with kinematic checkbox set to true...?
It's more complex hence prone to errors and less efficient. You have to code each and everything. It's recommended to use, if you want to do some physics calculations or collision detections etc. It's in between of using a fully physics based character controller and going with fully kinematic one (like built in character controller component). Built in character controller is more efficient and already has basic functionalities. These are all the things to consider before choosing one.
hey Ash Dev, when i wrote the player controller script and loaded unity again it was showing a error saying Assets\player controller(38,25):error CS1002: ; expected what do i do now please help me
For basic one, it's the same, the difference will only be in the animations. (For dogs, cats etc). But you won't be able to use the built in character controller because of the capsule collider you have to create a custom one but the approach will be same.
Just like sprinting, you can create a different speed and and set the current speed to that for your appropriate dash time and trigger it through some button (For basic approach). And then, add some kind of cool down timer so that, the player doesn't keeps on moving with the dash speed.
New input system is a whole different topic to explain, and it's not a good idea to explain two different things simultaneously. We'll cover it in some future tutorial.
Man, this was great. Basic, easy to setup, and scaleable. I definitely will be using this to build my first real movement system :D
im a big fan of all your work/script !!! Keep the good work ! lov u
Great tutorial!
Nicely explained as always!
If anyone wants to make it so that the diagonal speed is the same as the horizontal and vertical speeds, make sure to normalize the movement vector in the GroundMovement() function, so: Vector3 move = new Vector3(turnInput, 0, moveInput).normalized; . Also if you notice that there is a sliding/smoothing effect to your character after normalizing the movement vector, all you have to do is GetAxisRaw instead of GetAxis in the InputManagement() function.
I'm surprised people are still making videos without the "new" input system.
We'll make a seperate video on new inputs system, then you can add it wherever you want
Nice tutorial, as always !
Everything was working until 6:50, unity says that the forward in camera.forward isn't defined (sorry if this is simple, I just started using c#/unity) Do you have any solutions?
do you have "[SerializeField] private Transform camera;" under the references header? that's the only cause I can think of.
@@EmersonLovatt Thank you so much!!!
best channel
Thank you good work
How do I add the 2 straight lines at 7:32?
the key above enter and shift
@EmersonLovatt thank you
I HAVE FOUND GOLD
Hey guys if you found that your charactercontroller.isgrounded is not stable. make sure that the verticalvelocity when being grounded is less than 0. You could write just -1 or maybe something like verticalVelocity = -gravity * 0.1f;
Just FYI the CinemachineFreeLook is deprecated
Nice :D
great tutorial! I am having an issue though where the sprintSpeed is also effecting the jumpHight. when I press left shift I can run faster but I also jump higher even when im standing still. is this supposed to happen? if not how do i fix it?
It's not supposed to happen, please join our discord server and share the code snippet.
in Unity 6 preview, when you change in GroundMovement the move.y value to anything else than 0 the character tip over, stopping the possibility to jump, do you have a fix for that please?
Looking forward to the animation update :)
The animations tutorial have been uploaded, check it out 🙂
@@ashdev nice, thankyou
Hi, when I use the controller the character jumps up
I have a question. So you said you will use kinematic approach and use Character controller component. So what's the difference if we use character controller component or Rigidbody with kinematic checkbox set to true...?
It's more complex hence prone to errors and less efficient. You have to code each and everything.
It's recommended to use, if you want to do some physics calculations or collision detections etc.
It's in between of using a fully physics based character controller and going with fully kinematic one (like built in character controller component).
Built in character controller is more efficient and already has basic functionalities.
These are all the things to consider before choosing one.
hey Ash Dev,
when i wrote the player controller script and loaded unity again it was showing a error saying
Assets\player controller(38,25):error CS1002: ; expected
what do i do now please help me
You have to add " ; " at the end of each line of code, that's what this error is for
Thats awesome, also how do you make when making character controller that is like animal like a dog or snake or bird
For basic one, it's the same, the difference will only be in the animations. (For dogs, cats etc). But you won't be able to use the built in character controller because of the capsule collider you have to create a custom one but the approach will be same.
Great video
I would like to ask about the asset name you used in this video?
What asset?
@ashdev 9:34 the plane and cubes is that asset on unity asset store or you made it?
Hello,
How can we add dash function in this code ??..
Just like sprinting, you can create a different speed and and set the current speed to that for your appropriate dash time and trigger it through some button (For basic approach). And then, add some kind of cool down timer so that, the player doesn't keeps on moving with the dash speed.
Your script is buggy,I tried and it didnt work
Please follow the tutorial carefully, and if you still face the issue share the issue in are our discord server.
This was great! Thanks!
Is there a reason why you didn't use the new Input System?
New input system is a whole different topic to explain, and it's not a good idea to explain two different things simultaneously.
We'll cover it in some future tutorial.