At 13:58 you should add another handler: input.CharacterControls.Movement.canceled += ctx => movementPressed = false; If you don't do this then movement will not cancel if the user doesn't guide the stick back into the deadzone (they just release it so it snaps backs to centre). Will save someone 30 minutes trying to find where the bug is.
This comment is Golden when using the keyboard.. I had to put it on everything, aim, shoot, jump I'm still figuring out how I can get what I need outta the input system but.. yeah I'm closer now.. thanks again..
@@mohmmadatalla4664 Dude you saved me, the input was setting the bool to true and this was the only way I found to set it to false, luv ya appreciate ya
I like how you bring focus to the proper section of the UI by either zooming and blurring background or using the red arrows. Also nice to see a reminder of what was entered in the UI while going over the script.
Thank you for well explained tutorials, you have helped me a lot keep going man, i just want to mention 7:23 guys make sure that you choose pass through ( Action Type ) otherwise the player will keep moving in the idle state i've discovered this problem after 9 hours of digging Lol small advice make sure you have a cup of coffee to avoid these types of mistake xD, Again Thank you so much !!
Found this by chance but you explained this really well, making it far more understandable than others I have watched. Giving the info really is key for any viewers to learn so this was perfect. Good job, subbed for future stuff!
TNice tutorials is by far, the best tutorial I have found so far. I feel like I’ll be spending a lot of ti on your channel! Thanks man! Keep up the good
hey! thanks for your tutorial! Really well understanding and explicitly. I want to make a few suggestions about the code.(might be wrong..) 1. Instead of using if statement in the Update loop, I think using CharacterControls.Movement.cancelled to "SetBool = false" is better for performance. 2. There is no need to decide whether movementPressed is true or false using currentMovement.x != 0 || currentMovement.y != 0, because when the "performed" callback is in response, the button is pressed certainly.
Hey Eterlan! If you find more efficient ways of doing things in the code and everything works, go for the refactor! Code is always open to being optimized and refactored for the better! Love to see it, honestly. Cheers 🍻 -Nicky
Thanks! Very good and digestive tutorial. Sometimes when I watch tutorials, it feels like I need some discipline to keep watching, but for this, time passed in an instant, it flew so well.
Man OG OG I been messing with that Unity input system and no one out here explaining the callback f(x) like you. I been watching all these weird writing event function stuff and it make no sense to me. Been just reference my control scheme states instead of that performed function...still work, now I can pull out them more complex parameters like duration of that button press... Love your tutorials mane
After a series of really great videos, I'm now watching every video you post... which I do with only about 20 creators out of the hundreds of great youtubers on my shortlists. Keep up the great work.
Probably another really great tutorial I'll have to learn later today. Hope your Channel grows big, you put so much effort into it, and they come out as the best tutorials I've seen.
You are great! I've been looking for an explanation of the new input system for a long time and you explain things really well, in a clear and simple way! Thank you!
Awesome job to you Unicky (Bad pun😅)(Replying to your awesome job to us in the ending). Understood root motion and the new Input system. Excited for the next videos in the series.
Thank you so much for this informative series, I am terrible with code but am forcing myself to go through the steps and follow along, its really what drives the game so I have to learn some of it haha, for a good while I was fighting with the code and using copilot and chatgpt to figure out why my character kept moving despite letting go of the thumb stick and I figured out it was my controllers sensitivity, it would be above a certain threshold even if I thought it was centered, its not a really old controller but the inputs are apparently a little sensitive
I don't know if someone already asked, but how do the values get reset after receiving the input? runPressed will always be true after the first input (Run.performed). Same for currentMovement values they will always be 1 as soon as you press they key. I had to use CharacterControls.Movement.canceled in order to stop the motion. Is that the way is supposed to be? My question is how do you recognize a key being held with the new input system when the values do not update every frame? Thanks for the tutorials
For anybody who couldn't access the CharacterControls from the input. You need to place the PlayerInput script in the same location as the script trying to access it.
Dude you're AMAZING! You explain as you show how/where to find it. You show where to find it again with arrows. I could go on lol, but thanks your tutorial are what is was looking for. Thank you!!!
So I did this 5 times now and my character did not move from Idle. Then I checked 'on' the 2 Boolean parameters you created at 2:29, and it worked (albeit, he only walks, doesn't run), yet your character moved, walks, then runs, then walks, then runs.... How is that possible?
The issues: 14:44 when you tap the joystick player X position value is increasing (player is turning right) 16:09 again when you tap the yoystick X is increasing and also Y is decreasing (player is turning right and goes slowly under the plane). How to fix this?
@@iHeartGameDev Thank you for the reply! My colleagues and I are visual designers who are weak with coding, but decent with visual scripting of all sorts... Grasshopper, Houdini, etc.. it would be very helpful to see a tutorial from you on the topic.
Unsure if this is a bug or not, but I found that using "Value" as an Action Type with my controller causes the PlayerInput to 'stick', even when no value was actively being applied to the Control Type Vector2 of Movement. Switching to Pass-Through resolved this issue.
@@iHeartGameDev By stick, he ment the left analog stick on your controller for the input system. I've also encountered the same issue, since Vector is a float, it doesn't always round back to exactly 0... in the code you written "movementPressed = currentMovement.x != 0 || currentMovement.y != 0;" this causes potential issues since it specifies it to be exactly 0 but floats don't always exactly land at zero One way to solve this is to use Math.Round but that doesn't always work since the analog stick return to the center too fast may not always recognize the vector as (0, 0). Synaptic Studios suggestion fixed this issue by setting it to pass-through from the input system and it worked wonderfully! Your guides have also been amazing Nicky! Very detailed! Hoping to see if you can make a third person shooter in the future!
Thank you for this comment! I just couldn't figure out what was causing this behaviour, didn't even know what to google - this fixed it completely (and thanks to Nhan for describing why it happens)
soooo... how does this work with the previous animator tutorial where we used the velocity float to blend and play the animations for walk to run? finding the new input system to be quite confusing
well if release the button the character stops suddenly, which doesn't seem nice, do you have any idea, how we could smoothly ease in and out between the run, walk and idle.
with it in a few weeks or months if I pour enough ti and effort into it. I'll be watcNice tutorialng many more of your videos for tips and inspiration.
Anyone else has an issue where the character keeps moving if the stick is let go too fast? Like if I slowly bring to stick back to (0,0) the character stops as expectet but if I quickly pull my thumb off, the character keeps walking even if I'm not touching the stick anymore. Does somebody have an idea what could be the issue?
If somebody has the same problem and sees this, I found the solution! I added this bit of code : input.CharacterControls.Movement.canceled += ctx => { currentMovement = Vector2.zero; movementPressed = false; }; If I understood correctly, the issue was that the "canceled" event was called before the (0,0) value was registered and so movementPressed wasn't updated. Updating it here fixes that problem.
So, at 8:05 where you clicked the controller, when I did that, nothing happens, I had to right-click the controller and choose 'Open Device Debug View', only then did I see the activity you show in your video when clicking various controls on the controller. Thought this might help others.
I've a problem with the joystick..... Whenever I move a joystick (little bit) the speed of the player is slow but when I move joystick farther speed is normal...I'm using 2D rootMotion
wow that was one of the best tutorials I've seen. you show us everything AND most importantly -explain why. Thank you very much
Brackeys is gone, but seems like we have a new one here that may be taking his crown :D
He has potential
I was thinking the same thing!!
Brackeys helped us in though time ......
He's not Scandinavian, no sale!😂
At 13:58 you should add another handler:
input.CharacterControls.Movement.canceled += ctx => movementPressed = false;
If you don't do this then movement will not cancel if the user doesn't guide the stick back into the deadzone (they just release it so it snaps backs to centre). Will save someone 30 minutes trying to find where the bug is.
Had this issue, thought it was my controller failing.. ty!
This comment is Golden when using the keyboard.. I had to put it on everything, aim, shoot, jump I'm still figuring out how I can get what I need outta the input system but.. yeah I'm closer now.. thanks again..
@@mohmmadatalla4664 Dude you saved me, the input was setting the bool to true and this was the only way I found to set it to false, luv ya appreciate ya
Thank you so much for saving my 30 minutes! 🤝
I like how you bring focus to the proper section of the UI by either zooming and blurring background or using the red arrows. Also nice to see a reminder of what was entered in the UI while going over the script.
Almost 2 years later I still come back to the root motion section. It's explained way better than in the docs.
You know it, bro! 🙏
Timestamps AND actual explanations?
Thank god I found your channel
Thank you for well explained tutorials, you have helped me a lot keep going man, i just want to mention 7:23 guys make sure that you choose pass through ( Action Type ) otherwise the player will keep moving in the idle state i've discovered this problem after 9 hours of digging Lol small advice make sure you have a cup of coffee to avoid these types of mistake xD, Again Thank you so much !!
Thank you very much!
Damn, you saved me a lot of frustration!. Any reason why that happens?
You've done it again MR. Nicky
I have been trying to do some animations on a basic character for a week now. Finally, everything was resolved by this video. Thanks for the help
This is one of the best tutorials on Input I've seen in a long time! Very understanding in explanations. I hope you do much more in the future.
TNice tutorials tutorial is so useful,I tried tons of other tutorials but tNice tutorials was the best one
Been binging your vids all day to get a better understanding of movement controllers in unity, i love your vids man, thanks for being awesome!
Everytime I looking for something he always does it thank you
The best tutorial for learning animation character controlling.U are the best Sir!
So glad I took a chance watching this. It's criminal that you don't have a bigger following, this was a very well made instructional!
Found this by chance but you explained this really well, making it far more understandable than others I have watched. Giving the info really is key for any viewers to learn so this was perfect. Good job, subbed for future stuff!
I've been waiting for this video for so long, thank you!
Nicky my man, We love youuuuuuuuuu!! We're so greatful for all the work and effort. Please give up more! :D
lol 3:53 on pause helped me more than dozens of videos. thanks!
man I still love your work and the dedication you put into it. it is just amazing. Thanks for sharing.
TNice tutorials is by far, the best tutorial I have found so far. I feel like I’ll be spending a lot of ti on your channel! Thanks man! Keep up the good
hey! thanks for your tutorial! Really well understanding and explicitly. I want to make a few suggestions about the code.(might be wrong..)
1. Instead of using if statement in the Update loop, I think using CharacterControls.Movement.cancelled to "SetBool = false" is better for performance.
2. There is no need to decide whether movementPressed is true or false using currentMovement.x != 0 || currentMovement.y != 0, because when the "performed" callback is in response, the button is pressed certainly.
Hey Eterlan! If you find more efficient ways of doing things in the code and everything works, go for the refactor! Code is always open to being optimized and refactored for the better! Love to see it, honestly. Cheers 🍻 -Nicky
dude your great .I watched your video when ever i have doubt in player animation, you really deserve a medal .Thank you once again
It’s here! Woohoo!!! Amazing stuff as always!
I'm glad you are back! Keep continue brother.
that the best nwq input system tutorial! big thanks!
I found this video to be very complicated compared with how easy you make everything to understand in other videos. Good job anyway !
This is THE BEST tutorial!!! on the new input system why doesn't it has more views!!?!?!!
Thanks! Very good and digestive tutorial. Sometimes when I watch tutorials, it feels like I need some discipline to keep watching, but for this, time passed in an instant, it flew so well.
You have no idea how grateful I am for tNice tutorials series
Most Underrated channel in game dev.
Cheers! 🍻
Man OG OG I been messing with that Unity input system and no one out here explaining the callback f(x) like you. I been watching all these weird writing event function stuff and it make no sense to me. Been just reference my control scheme states instead of that performed function...still work, now I can pull out them more complex parameters like duration of that button press...
Love your tutorials mane
Underrated tutorial... You deserve Million sub's.. Great vid
hes just like us he didnt know about this, but he learned it and shared it to us. Thanks a lot!
Absolutely brilliant tutorial. Your combination of clear instructions and great video editing is the perfect combination.
I think you are the best unity helper on all universe thanks to you for helping us so much
thanks Freddy!
After a series of really great videos, I'm now watching every video you post... which I do with only about 20 creators out of the hundreds of great youtubers on my shortlists. Keep up the great work.
Fantastic. Great job Nicky.
in unity i get an error that states (Parameter 'Hash 20590411' does not exist) how do you fix that?
This is an amazing video to learn the new input system.
Probably another really great tutorial I'll have to learn later today. Hope your Channel grows big, you put so much effort into it, and they come out as the best tutorials I've seen.
Dude your tutorials are a saving grace please continue the work you’re doing
wow this is so well made, more please just found the channel
Thanks for watching JustBitsAndPieces! :D
you're a great teacher, love the simplicity, with details! subbed!
You are great! I've been looking for an explanation of the new input system for a long time and you explain things really well, in a clear and simple way! Thank you!
Thanks so much Laurent!
fav and tysvm for this tutorial it was helpful❤️.
Thank you! Hope the newer content helps too!
Clean and informative video, thank you+
help to get the basics and I'll jus move from there. Thank you!
Awesome stuff my man :)
Excellent job Nicky! Keep it up!!
Thank you so much for creating this tutorial!
It's been a great help for transitioning to the new Input System from the old one!
Subscribed!
Thank you for watching Aspiring Hero Games! Good luck with your dev journey
@@iHeartGameDev excuse me I have some unity question. somebody can help me?I am Taiwanese so my English is not well.
Awesome job to you Unicky (Bad pun😅)(Replying to your awesome job to us in the ending). Understood root motion and the new Input system. Excited for the next videos in the series.
Really useful video, super easy to follow and everything was explained so well! Thanks
Can you do a cinemachine tutorial ?
Amazing tutorial, keep it up the good work !
Loving your content ⭐⭐⭐⭐⭐
You're tutorials are so awesum!!!
Thank you so much for this informative series, I am terrible with code but am forcing myself to go through the steps and follow along, its really what drives the game so I have to learn some of it haha, for a good while I was fighting with the code and using copilot and chatgpt to figure out why my character kept moving despite letting go of the thumb stick and I figured out it was my controllers sensitivity, it would be above a certain threshold even if I thought it was centered, its not a really old controller but the inputs are apparently a little sensitive
I don't know if someone already asked, but how do the values get reset after receiving the input? runPressed will always be true after the first input (Run.performed). Same for currentMovement values they will always be 1 as soon as you press they key. I had to use CharacterControls.Movement.canceled in order to stop the motion. Is that the way is supposed to be? My question is how do you recognize a key being held with the new input system when the values do not update every frame? Thanks for the tutorials
For anybody who couldn't access the CharacterControls from the input. You need to place the PlayerInput script in the same location as the script trying to access it.
What do you mean in the same place?
@@janpatrickconde4933 scripts need to be in the same physical folder
@@richardrothkugel8131 Oh ok, I understand now. Thank you!
is there a tutorial for keyboard movement?
Thanks for a great video. However, if I wanted to use keyboard and mouse with that setup, how would the script be different? (and input)
Bump
Dude you're AMAZING! You explain as you show how/where to find it. You show where to find it again with arrows. I could go on lol, but thanks your tutorial are what is was looking for. Thank you!!!
Thanks so much Bugzzy! 😊 happy to hear that you like the videos!!
was a life-saver. Thanks a lot.
Nice, your animation tutorials are so useful
The best!
One more great tutorial! Are you planning to make series about IK you mentioned before?
Yes it can - don't despair!
very good and quality materials, thanks.
So I did this 5 times now and my character did not move from Idle. Then I checked 'on' the 2 Boolean parameters you created at 2:29, and it worked (albeit, he only walks, doesn't run), yet your character moved, walks, then runs, then walks, then runs.... How is that possible?
Great video!! Eager for the video on Animation Rigging package! 😄
thank you man,you are a legend
What Plugins you got for vs code Im not getting something here.
There’s a full setup process for VSCode! I think there are some video tutorials that will help! Check out SamYam!
Nicky hello, could you please do IK tutorial from scratch?
The issues:
14:44 when you tap the joystick player X position value is increasing (player is turning right)
16:09 again when you tap the yoystick X is increasing and also Y is decreasing (player is turning right and goes slowly under the plane).
How to fix this?
How about for Keyboard inputs?
2:30 this the part i wash looking for but how im able to do smarting like this on the event system ?
Great video! How would you recommend changing the charactermovement script to move the character based on the position of a cinemachine camera
Thank you, sir, for this excellent tutorial! Is it possible to use the new visual scripting to achieve the same result?
@@iHeartGameDev Thank you for the reply! My colleagues and I are visual designers who are weak with coding, but decent with visual scripting of all sorts... Grasshopper, Houdini, etc.. it would be very helpful to see a tutorial from you on the topic.
decided to try it out.
how do you add camera view to right thumb stick?
Unsure if this is a bug or not, but I found that using "Value" as an Action Type with my controller causes the PlayerInput to 'stick', even when no value was actively being applied to the Control Type Vector2 of Movement. Switching to Pass-Through resolved this issue.
@@iHeartGameDev By stick, he ment the left analog stick on your controller for the input system.
I've also encountered the same issue, since Vector is a float, it doesn't always round back to exactly 0...
in the code you written "movementPressed = currentMovement.x != 0 || currentMovement.y != 0;"
this causes potential issues since it specifies it to be exactly 0 but floats don't always exactly land at zero
One way to solve this is to use Math.Round but that doesn't always work since the analog stick return to the center too fast may not always recognize the vector as (0, 0).
Synaptic Studios suggestion fixed this issue by setting it to pass-through from the input system and it worked wonderfully!
Your guides have also been amazing Nicky! Very detailed! Hoping to see if you can make a third person shooter in the future!
Thank you for this comment! I just couldn't figure out what was causing this behaviour, didn't even know what to google - this fixed it completely (and thanks to Nhan for describing why it happens)
soooo... how does this work with the previous animator tutorial where we used the velocity float to blend and play the animations for walk to run?
finding the new input system to be quite confusing
You explained it very well.
well if release the button the character stops suddenly, which doesn't seem nice, do you have any idea, how we could smoothly ease in and out between the run, walk and idle.
with it in a few weeks or months if I pour enough ti and effort into it. I'll be watcNice tutorialng many more of your videos for tips and inspiration.
The tutorial is dope but where is the generated new input script attached?
I like to see how other use the new Input System, well done Nicky👍.
such a good explanation.
thank you bro keep going up
Can Armor X Pro used in programming the motion of 3 d characters in unity 3d ?
Can you explain me how we can block that the character pass through the walls when using an animation with root motion ? :(
Nicely done! I've been very eager for a new input system, the old one was so bad for local co-op games.
Does soft soft co with the samples? And are these copyright free?
Anyone else has an issue where the character keeps moving if the stick is let go too fast? Like if I slowly bring to stick back to (0,0) the character stops as expectet but if I quickly pull my thumb off, the character keeps walking even if I'm not touching the stick anymore. Does somebody have an idea what could be the issue?
Hey! Try adding the .cancelled callback
If somebody has the same problem and sees this, I found the solution!
I added this bit of code :
input.CharacterControls.Movement.canceled += ctx => {
currentMovement = Vector2.zero;
movementPressed = false;
};
If I understood correctly, the issue was that the "canceled" event was called before the (0,0) value was registered and so movementPressed wasn't updated. Updating it here fixes that problem.
Thank you
So, at 8:05 where you clicked the controller, when I did that, nothing happens, I had to right-click the controller and choose 'Open Device Debug View', only then did I see the activity you show in your video when clicking various controls on the controller. Thought this might help others.
Great video! Tons of useful information 🙂
This was an amazing tutorial
I've a problem with the joystick..... Whenever I move a joystick (little bit) the speed of the player is slow but when I move joystick farther speed is normal...I'm using 2D rootMotion