I've seen so many confusing and ridiculous tutorials for this new system, each of them about half an hour long. This tutorial was quick, simple, and useful. I feel like I lost 500 braincells from all the other videos but gained 1000 from this one.
I am still learning coding and unity and was intimidated by the new input system. Every other tutorial made this way more complicated than it needed to be. Your tutorial made it crystal clear within minutes. You have given me motivation. I've subscribed to your channel because of this. Thank you
This has been one of the best tutorials I have seen on the New Input System. Thanks. No time at all and I've got movement that can be done with controller or keyboard.
Another great video bendux, these short and succinct videos are great for beginners looking to have concepts simplified while also being very useful for more experienced developers looking to learn a new system. Keep it up!
Hey great tutorial fast and quick and straight to the point! One question though, for some reason even though I have done exactly as you said while also adding the ground check to my player. They are unable to jump or fall. They don't even need my land to walk, they will just walk on air. How shall I go about fixing this. Best Wishes
for some reason when i hit play the transform component keeps making my character go down it does not even stop when it hit the ground? can u help me with it
Great tutorial. Very practical and concise. This helped me a lot by getting a fist handle in the new Input System while making something useful and replicable in a simple 2D platformer. Thanks, great work! ❤
Finally someone that does this easy, I've been trying so many other ways to do this and adapting old input system code to the new one with varying results but this is just... Simple and I can expand it as I want *easily* EDIT: Now my jump is EXTRA floaty for some reason and I didn't touch anything but yeah
As far as I know, you don't need to set the velocity in FixedUpdate if you set it as shown. Maybe I'm wrong, but that's how they do it in the documentation.
I followed all the steps but in the last part when I was going to assign the Move and Jump in PLayer Events, it didn't show in the list, it only shows static parameters and no dynamic callback context, please help
Thanks for the tutorial but i cannot get it working. Movement is fine the Problem i have is with jumping ,its like stuck and i have to button mash to get a jump out. I already posted the problem in discord with a video.
For some reason the Public Move(InputAction.CallbackContext context) is not showing up in the unity inspector under events like its supposed to at 6:40. I'm using version 2020.3.12f1
OMG I'M SO DUMB😂. I was trying to put the script in the Device Lost Event Instead of the "Move" Action we made in the Action Map. After I realized that It started working like it was supposed to.
Did you ever consider creating a tutorial how add in a crouch function for 2D animations ducking down like mario games? you should consider that. A lot of Unity RUclipsrs dont do that. it would help to have a basic start up 3 movement function character. walk. jump and crouch
@@megacheecks1603 Yeah i did that but his method is still a lil confusing to add in with my own project. im seeing different methods to do this im noticing now looking at the different scripts in git hub
It works to play on the screen and the joystick, but when you play my game on Android, and I use the touch controls, the game freezes or closes in a few seconds, if I deactivate the on-screen controls the game doesn't freeze, what could it be?
when you let your square slowly fall of the corner and then move to the opposit direction back on the platfrom it is standing on the platfrom but is no longer able to jumb. how can i fix this?
Okay everything works except that when I jump, my player has this effect that they are bouncing after the jump, as well as if I hold the jump button down they constantly do this "bouncing"
Okay I realize what I did wrong, I tried using the physics script on the player, but what I needed to do was simply remove the physics script component from the player and just turn on "Dynamic" body type on the rigidbody 2D component (which defaults to Kinematic originally)
im getting an error that says "NullReferenceException while executing 'performed' callbacks of 'Player/Jump[/DualShock4GamepadHID/buttonSouth]'" how can i fix this
I have a question. Why do I need a separate object to check if the player is on the ground? Can't I use the player object itself to check for the ground.
Hi, I feel like I've followed your instructions, but when I create the "Input Actions" it does not give me any defaults, its all completely blank. The DefaultInputActons file is in the package, I can see it, but none of it shows up when I create my own in the assets. What am I doing wrong? There is no create inputactions button in the player input part of the debug area like there is on your video either?
I have the same feelings as the top comments, and also subscribed and instantly I see all your videos are exactly what I was looking for and things I had hope to implement so I am glad to find it all in one place. One random question on this video however, what is your mass and gravity scale set to for the rigid body as when not moving left or right my character falls very hard straight down when mid jump and I would guess it is to do with those settings?
Hi! This is a great tutorial! I am having an issue where when I press jump the character flies up into the air and the y velocity keeps being added to and im not sure why. Any ideas?
@@bendux Hey! Figured out the issue. I was trying to make the movement framerate independent but was going about it the wrong way! I had float frameFixMultiplier = Time.deltaTime * desiredFramerate Was doing rb.velocity = new Vector2(x movement stuff, rb.velocity.y) * frameFixMultiplier This was constantly increasing the velocity of the rb. I fixed this by doing: rb.velocity = new Vector2 (x movement stuff * frameFixMultiplier, rb.velocity.y ) Had me stumped for a while, but nothing was wrong with your tutorial! Thanks very much for replying and giving a possible solution, it is nice that you reply even after years of uploading x
Genuine question: how can i add my Rigid Body to the rb component in the script? for whatever reason it isn't working. in fact its not even registering the Rigid Body 2d at all.
Hey great video this must be the most easiest tutorial i can find in youtube but 1 question why when i jump he slowly gets down in the ground i want it to be fast cause it looks like hes gliding on the air any fixes for this? =/
Hi there, I'm having the same issue, the character gets stuck on walls and platforms eventually. I've created physics material 2d for the rigidbody 2d and for the platforms, but it didn't solve the issue
@@bendux I've found the solution for my issue. I originally used the tile palette to "draw" the tiles for the platforms. This caused the ground to be composed of multiple "square" colliders, and the corners of these tiles caused a bug where the character gets stuck even if a visible gap is found between the character and the ground. Long story short, to solve this I added a component called "Tilemap Collider 2D" to the tilemap, this component merges all the tiles into a contiguous collider.
Thank you for the tutorial! However for some reason my character is moving at the left at awake, and when I touch a button it immediatly stops moving... I'm struggling to find the root cause, do you have any hint?
Hello! the GroundCheck works well when the player is on solid ground, but if the player goes into a corner the player hitbox is not allowing the player to fall, but the player can't jump because the ground check is in the air, how can I fix that? Thanks in advance
The answer to your question goes beyond the scope of a RUclips comment, but I'd still like to help you. Join our Discord server, and let's solve your problem together!
Thank you for the tutorial. I have a little constructive criticism, and its to explain some things, like whats happening at 4:15 In general great tutorial though, tysm.
Hello! amazing video and please I have a question that I couldn't figure out on the internet: if we make a function like that Jump(callback) and we want to run that function at fixedupdate how can we do it?( For certain physics based things that would be better in fixedupdate)
@@bendux you single handedly saved my jam entry thank you so much I came back for the falling platforms tutorial too, your tutorials are so helpful to the point and easy to follow thank you so much
@@bendux if you multply the jumpPower and speed * Time.deltaTime you'll have to use extremly large numbers to be able to move at all, that makes the game bug in some time and give you ultra high jumps or moving lag
@@TyricSatyric As far as I know, you don't need to multiply by Time.deltaTime if you set the velocity as shown. Maybe I'm wrong, but that's how they do it in the documentation.
Best video I've seen so far but I need some help... Did everything like u did but my character won't flip. Looks like scripts doesn't multiple localScale.x by -1f Any idea how to fix it?
Hey, I'm having trouble with the flipping feature. For some reason, my character flips to the left whenever he moves in any direction, and then can't flip back to normal. What am I doing wrong?
Thank You so much. this really brightened my day ;) A Very quick and easy to understand Video! But how do you handle it if you want to use two separate Controllers, for a Couch Multiplayer Game for example?
@@bendux Cool, I've tried so many tutorials but they always use some premade script that I don't know how to make or don't explain it well or skip through vital explanations of what does what
I've seen so many confusing and ridiculous tutorials for this new system, each of them about half an hour long.
This tutorial was quick, simple, and useful. I feel like I lost 500 braincells from all the other videos but gained 1000 from this one.
Haha, thank you!
That's exactly my sentiments
300 profit
I am still learning coding and unity and was intimidated by the new input system. Every other tutorial made this way more complicated than it needed to be. Your tutorial made it crystal clear within minutes. You have given me motivation. I've subscribed to your channel because of this. Thank you
finally a tutorial that uses the latest version!
6:27 i don't have the other things like rb and ground check and ground layer! How on earth am i supposed to do this
bro you deserve more than that view, i hope you don't quit
Thank you for this. I have been doing things the old way and found it annoying with the older system. Big thanks to you sir!
This channel has very useful high quality tutorials! You earned a new subscriber😉.
This has been one of the best tutorials I have seen on the New Input System. Thanks. No time at all and I've got movement that can be done with controller or keyboard.
After watching about 50 input tutorials, one that seems to actually make sense.. with a simple example that actually works!!
Thank you so much! I learned a lot from this.
Finally a good video tutorial about this topic, easy and clean!
Another great video bendux, these short and succinct videos are great for beginners looking to have concepts simplified while also being very useful for more experienced developers looking to learn a new system. Keep it up!
Excellent tutorial. Very simple and straight to the point, thank you! :)
Hey great tutorial fast and quick and straight to the point! One question though, for some reason even though I have done exactly as you said while also adding the ground check to my player. They are unable to jump or fall. They don't even need my land to walk, they will just walk on air. How shall I go about fixing this.
Best Wishes
If you want your player to be affected by gravity, set the gravity scale of your player's Rigidbody 2D component to something greater than zero.
Nice, simple approach and clean, concise, very helpful tutorial. Subscribed!
Best tutorial out there about movement with new Input System. Thanks!
Лучшее видео на эту тему, спасибо тебе огромное, я потратил примерно 4 часа впустую пока не наткнулся на тебя.
Great tutorial, thank you! I was also able to add a multi-jump feature, and I'll probably add a dashing feature as well later.
I was just giving up on the new input system. Luckily I came across your video.
for some reason when i hit play the transform component keeps making my character go down it does not even stop when it hit the ground? can u help me with it
Does your ground have a Box Collider 2D component?
@@bendux thank u
Great tutorial. Very practical and concise. This helped me a lot by getting a fist handle in the new Input System while making something useful and replicable in a simple 2D platformer. Thanks, great work! ❤
So far best video with new Input system. Really.
Finally someone that does this easy, I've been trying so many other ways to do this and adapting old input system code to the new one with varying results but this is just... Simple and I can expand it as I want *easily*
EDIT: Now my jump is EXTRA floaty for some reason and I didn't touch anything but yeah
Increase the gravity scale of your player's Rigidbody 2D component.
It was really helpful for a quick and dirty intro to it. Thanks!
Awesome video, I have a question however. Shouldn't the physics be handeled in FixedUpdate instead of Update?
As far as I know, you don't need to set the velocity in FixedUpdate if you set it as shown. Maybe I'm wrong, but that's how they do it in the documentation.
amazing tutorial,
you really helped a lot
Nice tutorial Finally I can continue on my University Project Thank you so much
Thank you man, I actually learned something from this tutorial. In others I just switch tabs and copy code.
I like the way you so clearly explain. I wish you expanded to 3d games. Subbed. Your Object Pooling joke got me here
Thanks man. I learned a lot! ❤️
Aren't the rigidbody forces supposed to go into fixedupdate?
I followed all the steps but in the last part when I was going to assign the Move and Jump in PLayer Events, it didn't show in the list, it only shows static parameters and no dynamic callback context, please help
MY BAD, i saw the problem, it must be public int the script I wrote private.
Btw you explain it so simple I was able to catch up on what you saying, Nice tutorial
I'm glad you were able to fix it.
Thanks for the tutorial but i cannot get it working. Movement is fine the Problem i have is with jumping ,its like stuck and i have to button mash to get a jump out. I already posted the problem in discord with a video.
For some reason the Public Move(InputAction.CallbackContext context) is not showing up in the unity inspector under events like its supposed to at 6:40. I'm using version 2020.3.12f1
OMG I'M SO DUMB😂. I was trying to put the script in the Device Lost Event Instead of the "Move" Action we made in the Action Map. After I realized that It started working like it was supposed to.
I'm glad you were able to fix it.
Did you ever consider creating a tutorial how add in a crouch function for 2D animations ducking down like mario games? you should consider that. A lot of Unity RUclipsrs dont do that. it would help to have a basic start up 3 movement function character. walk. jump and crouch
Check out Brackeys tutorial on 2d movement
@@megacheecks1603 Yeah i did that but his method is still a lil confusing to add in with my own project. im seeing different methods to do this im noticing now looking at the different scripts in git hub
@@xDTHECHEMISTx Okay Epic. Good luck bruv
Good idea! I've added it to my list. Thank you for the suggestion!
@@bendux Anytime! im enjoying creating with Unity and like to learn a lot of different methods as i progress.
It works to play on the screen and the joystick, but when you play my game on Android, and I use the touch controls, the game freezes or closes in a few seconds, if I deactivate the on-screen controls the game doesn't freeze, what could it be?
how would you add a double jump or others abilities with this new input system?
when you let your square slowly fall of the corner and then move to the opposit direction back on the platfrom it is standing on the platfrom but is no longer able to jumb. how can i fix this?
Increase the radius of the ground check in the script.
The character can walk but not jump. the code does not give an error, how can I solve it
Did you position the ground check at your player's feet?
@@bendux thanks, I solved it
video starts at 1:11
I have a problem a ready line keep appearing underneath my using UnityEngine.InputSystem
What do you mean?
Okay everything works except that when I jump, my player has this effect that they are bouncing after the jump, as well as if I hold the jump button down they constantly do this "bouncing"
Okay I realize what I did wrong, I tried using the physics script on the player, but what I needed to do was simply remove the physics script component from the player and just turn on "Dynamic" body type on the rigidbody 2D component (which defaults to Kinematic originally)
I'm glad you were able to fix it.
Thanks sooo much! Insanely helpful! You should start to upload again
So it's kinda like an abstracted finite state machine?
Are you able to change the movement from arrow keys to wasd?
im getting an error that says "NullReferenceException while executing 'performed' callbacks of 'Player/Jump[/DualShock4GamepadHID/buttonSouth]'" how can i fix this
Would you like to show me your code on Discord?
@@bendux sure
Really cool tutorial! Thanks!
most underrated video i have seen
Thank you very much !! It helps me to solve the character's flip problem !!
Love it! How would coyote timing and jump buffering work with this? Where would the counters be checked and reset etc.
Thanks!
We have a solution for that on our Discord server. Feel free to join!
I have a question. Why do I need a separate object to check if the player is on the ground? Can't I use the player object itself to check for the ground.
There are many ways to check if a game object is grounded.
Hi, I feel like I've followed your instructions, but when I create the "Input Actions" it does not give me any defaults, its all completely blank. The DefaultInputActons file is in the package, I can see it, but none of it shows up when I create my own in the assets. What am I doing wrong? There is no create inputactions button in the player input part of the debug area like there is on your video either?
can't add script component "playermovment" because the script class cannot be found
Does your script have the same name as your class?
TYSM for this amazing tutorial
Good Tutorial
Hi there. I dont know why, but the code isnt working for me. I cant see the Playermove script in the JUMP and MOVE events under the input system
Did you save the script?
Excellent,Simple and well explained tutorial!! New sub :D
I have the same feelings as the top comments, and also subscribed and instantly I see all your videos are exactly what I was looking for and things I had hope to implement so I am glad to find it all in one place.
One random question on this video however, what is your mass and gravity scale set to for the rigid body as when not moving left or right my character falls very hard straight down when mid jump and I would guess it is to do with those settings?
Would you like to show me your code on Discord?
Hi! This is a great tutorial! I am having an issue where when I press jump the character flies up into the air and the y velocity keeps being added to and im not sure why. Any ideas?
Increase the gravity scale of your player's Rigidbody 2D component.
@@bendux Hey! Figured out the issue. I was trying to make the movement framerate independent but was going about it the wrong way!
I had float frameFixMultiplier = Time.deltaTime * desiredFramerate
Was doing rb.velocity = new Vector2(x movement stuff, rb.velocity.y) * frameFixMultiplier
This was constantly increasing the velocity of the rb. I fixed this by doing:
rb.velocity = new Vector2 (x movement stuff * frameFixMultiplier, rb.velocity.y )
Had me stumped for a while, but nothing was wrong with your tutorial! Thanks very much for replying and giving a possible solution, it is nice that you reply even after years of uploading x
@@SwaibaFaisal As far as I know, it's not necessary to multiply by Time.deltaTime when setting the velocity directly.
Genuine question: how can i add my Rigid Body to the rb component in the script?
for whatever reason it isn't working. in fact its not even registering the Rigid Body 2d at all.
There is a Rigidbody component and a Rigidbody 2D component. Did you accidentally add the wrong component to your player?
@@bendux that is possible
Hey great video this must be the most easiest tutorial i can find in youtube but 1 question why when i jump he slowly gets down in the ground i want it to be fast cause it looks like hes gliding on the air any fixes for this? =/
Increase the gravity scale of your player's Rigidbody 2D component.
The player gets stuck on the walls/platforms. How to fix that?
Create a Physics Material 2D with no friction and add it to your player's Rigidbody 2D component.
Hi there, I'm having the same issue, the character gets stuck on walls and platforms eventually. I've created physics material 2d for the rigidbody 2d and for the platforms, but it didn't solve the issue
@@leangalz Would you like to show me your code on Discord?
@@bendux I've found the solution for my issue. I originally used the tile palette to "draw" the tiles for the platforms. This caused the ground to be composed of multiple "square" colliders, and the corners of these tiles caused a bug where the character gets stuck even if a visible gap is found between the character and the ground.
Long story short, to solve this I added a component called "Tilemap Collider 2D" to the tilemap, this component merges all the tiles into a contiguous collider.
@@leangalz I'm glad you were able to fix it. Thank you for sharing your solution!
Should I use Performed anyway if I wan't to spawn something on button press?
Yes!
Great tutorial, but I had one question. Do you know how to stop your character from flipping around after they fall off?
Freeze the rotation of your player's Rigidbody 2D component.
@@bendux Thank you!
Super helpful video, thanks!
When will you made an tutorial (integrating this) whit animations ?
:D !
I definitely want to make a video about animations in the future.
your tutorials are just so nice to watch, superb quality! keep up the great work.
Thank you for the tutorial! However for some reason my character is moving at the left at awake, and when I touch a button it immediatly stops moving... I'm struggling to find the root cause, do you have any hint?
It's hard to tell what's going on without seeing your script.
thanks for this! Im starting with unity and this is very helpful. 😊
can you make a tutorial on how to add cyote time into this movement script? i cant seem to figure it out because their different scripts
We have a solution for that on our Discord server. Feel free to join!
Hello! the GroundCheck works well when the player is on solid ground, but if the player goes into a corner the player hitbox is not allowing the player to fall, but the player can't jump because the ground check is in the air, how can I fix that? Thanks in advance
The answer to your question goes beyond the scope of a RUclips comment, but I'd still like to help you. Join our Discord server, and let's solve your problem together!
@@bendux yeah that is also a solution I did not think about :P thank you very much will do
Thank you for the tutorial. I have a little constructive criticism, and its to explain some things, like whats happening at 4:15
In general great tutorial though, tysm.
My Player dont wants to jump when pressing space on pc. i am not knowledge in unity. also i am using 2023 vers
If you follow the video step by step, you should end up with a moving and jumping player.
@@bendux I watched it multiple times but idk what went wrong, I've played around with the ground check radius aswell but no results for jumping
although, removing the isgrounded clause in the jump if statement makes it work so it does have to do with that
Hello! amazing video and please I have a question that I couldn't figure out on the internet: if we make a function like that Jump(callback) and we want to run that function at fixedupdate how can we do it?( For certain physics based things that would be better in fixedupdate)
Edit > Project Settings > Input System Package > Update Mode
Hey is there any way to stop the controller getting stuck on the sides of platforms?
Create a Physics Material 2D, set the friction to zero, and add it to your player's Rigidbody 2D component.
@@bendux omg that was so fast thank you so much, currently doing GMTK game jam you're an absolute lifesaver
@@alexanderthegreat4817 Good luck!
@@bendux you single handedly saved my jam entry thank you so much I came back for the falling platforms tutorial too, your tutorials are so helpful to the point and easy to follow thank you so much
Amazing tutorial!
BTW I really wanted those sprites, where can i find them?
I made the sprites myself in Aseprite.
@@bendux oh, nice
@@levyathan4048 As far as I know, Piskel, LibreSprite, and GIMP are good alternatives to Aseprite.
the bad part is that i cant use time.deltatime because the game breaks
What do you mean?
@@bendux if you multply the jumpPower and speed * Time.deltaTime you'll have to use extremly large numbers to be able to move at all, that makes the game bug in some time and give you ultra high jumps or moving lag
@@TyricSatyric As far as I know, you don't need to multiply by Time.deltaTime if you set the velocity as shown. Maybe I'm wrong, but that's how they do it in the documentation.
@@bendux that is exactly what i made and the game broke
@@TyricSatyric Would you like to show me your code on Discord?
Only geting mesege thad says when controller is connected and disconected
Join our Discord server, and let's solve your problem together!
Thanks! It really helped!
this video is a godsend. Bless
Quick and simple. Thank you!
Best video I've seen so far but I need some help...
Did everything like u did but my character won't flip. Looks like scripts doesn't multiple localScale.x by -1f
Any idea how to fix it?
Would you like to show me your code on Discord?
@@bendux sent :D (edit: on priv)
Hey, I'm having trouble with the flipping feature. For some reason, my character flips to the left whenever he moves in any direction, and then can't flip back to normal. What am I doing wrong?
Would you like to show me your code on Discord?
@@bendux Nevermind, I went over the source code, compared it to mine, and realized I made a typo! Thanks for the tutorial.
@@evelynmeenan2608 I'm glad you were able to fix it.
is there any way to disable that little thunder icon on the top?
docs.unity3d.com/Manual/GizmosMenu.html
Thank You so much. this really brightened my day ;) A Very quick and easy to understand Video!
But how do you handle it if you want to use two separate Controllers, for a Couch Multiplayer Game for example?
I definitely want to make a video about local multiplayer in the future.
@@bendux Awsome!
And i have noticed that when u long click the space bar he jumps higher how do i disable this
Don't multiply the vertical velocity by 0.5 when releasing the jump button.
i want to jump using the Screen Button, where is the tutorial?
Join our Discord server, and let's solve your problem together!
Hi is there a way to go up and down using the left stick like a tile map game?
Of course, but the answer to your question goes beyond the scope of a RUclips comment. Join our Discord server, and let's solve your problem together!
waht virsion do u use cus i cant use new input sisten even tho i use newest virsion
It should also work with newer versions of Unity.
I don't know what I'm doing wrong but nothing is working, I can't move or jump
Do you get any error messages?
help, I removed the asset now my player doesn't move, and buttons wont work
pls help
You can create new input actions in the Player Input component.
Jump and move don't pop up in the callbackcontext I feel like I'm doing something wrong.
It was a typo in my script I had private when I need public.
I'm glad you were able to fix it.
Your videos are great I have a bit of a learning problem and I can easily follow your videos thank you.
Decent tutorial! Thanks.
im a big fan of yours, hope you do a tutorial about create your own gravity system and not depend on rigidbodies
great vid but for me i ran into a problem no errors but i can infinite jump how do i fix this
Join our Discord server, and let's solve your problem together!
really good tutorial 👍
Great tutorial. Thank you very much :D.
Is there a way where you can play it with 2 controllers and 2 players. So basically casual multiplayer
I definitely want to make a video about local multiplayer in the future.
@@bendux Oh, ok thx. But do you know how to make the player slower?
@@vertix2347 Adjust the speed value in your player's movement script.
Is this applicable to a 2-player fighting game with multiple player choices?
It's possible with Unity's new input system. I definitely want to make a video about local multiplayer in the future.
@@bendux Cool, I've tried so many tutorials but they always use some premade script that I don't know how to make or don't explain it well or skip through vital explanations of what does what
can someone tell me how to use the dash with this new inupt system?
We have a solution for that on our Discord server. Feel free to join!