finally a video about the new input system that goes straight to the point and isn't long, ty very much
@Enginering4 жыл бұрын
lol 😂 i was trying to comment same thing
@Jicefrost4 жыл бұрын
same comment)
@lepe4 жыл бұрын
I couldn't stop staring at that "OnDisalbe" lol
@goldkat993 жыл бұрын
Absolutely brilliant, I had given up on my game back in march because I tried to refactor it to the new input system and I could not figure it out. All of the documentation and videos at the time were incredibly confusing but your video was comprehensive and straight to the point.
@johneyre94933 жыл бұрын
This was by far the best tutorial I've seen on the new Input system.
@kitchenspider15394 жыл бұрын
A much needed tutorial, thank you! For a long time I was confused by the input action controller component and linking it to events. Now that I see how this is implemented purely in code, it is a lot clearer (and cleaner imo).
@wadeeliason9694 жыл бұрын
I agree. I had created a character and code from various tutorials using the old input system. But was a little confused on how to migrate to the new system. My other thought is implementing it into the UI controlling.
@kitchenspider15394 жыл бұрын
@@wadeeliason969 I think the biggest source of confusion for me was the PlayerInput component, which is imo virtually worthless and I've heard there is a consensus on that. I kept thinking the Input control asset, the PlayerInput component and the code were all supposed to work together as one system when in actuality you're better off using the asset w/code, or doing it all with code in simpler cases like the video here. Infallible Code has an excellent video on using the asset without the confusion of having the PlayerInput component here: kzbin.info/www/bejne/o6fYiYKvgN9qoZY Thats if you need a bit more complexity to the assignment of your controls without having to hard code each callback. He uses an interface from the auto-generated class to automagically generate all the events and their callbacks for you... so you basically reference ONE thing (the interface) and you can do your OnMove(), OnJump(), or whatever actions you have set up in the asset without having to do all the other crap, like the lambda callback ctx statements for every action. I didn't know these callbacks were already coded in the auto-generated class as an interface until I watched this video, and this has simplified the input system tremendously for me.
@kodaxmax4 жыл бұрын
@@kitchenspider1539 yeh im not sure how they ever thought the added convolutedness of needing a controller and such was easier than typing Input.getAxis("buttonName");
@visclo47824 жыл бұрын
ah it's so sad I can't kiss you because of the pandemic, thank you sooo much dude! 9 min video and you managed to learn me something I couldn't figure out for a whole day
@polarcat01564 жыл бұрын
that's sus
@RumpledCode4 жыл бұрын
00:21 - Tutorial Start 01:09 - Coding Start
@MetalStormGames3 жыл бұрын
Very helpful. I am trying to learn the new input system and just slowly expand on it instead of diving right in and this is exactly what i needed.
@random_precision_software3 жыл бұрын
I love coMing across new channels(to me anyway) and can't wait for more content! Subbed!
@natedizzy49394 жыл бұрын
omfg so many bad tutorials that do not teach you ANYTHING about using the system. i just finished a tutorial that was 20 minutes and 2 full (dense af) pages of code to do what you did in a few lines. and that one didnt even work properly. on top of that it was very difficult to keep up with what was happening in the code...also actually explaining what you do and why helps a lot too. thank you!
@TheEquilibrium663 жыл бұрын
Thank you so much, i was going to be crazy about new input system ( i'm new to programming) and finally i found a clean and correct way to do things, thank you again!
@spectralspace88664 жыл бұрын
i have watched tutorials about new input system. Now i learned after I've watched this!.
@haachamachama73 жыл бұрын
Man, I understand why they made this new input system, as it's a lot more versatile, but it's not very easy to figure out on your own lol, wow, what a confusing system! I've been using the old system for the past year, just started a job where the team was using the new system, I spend hours trying to figure it out, even looking at the code they used for movement, I had no clue it could be done this way. Thanks for the tutorial.
@puppamilaspranga4 жыл бұрын
this is such a useful video... i'm a noob at coding and all the videos i found are so hard to understand. I tried different videos and different methods with the "callbacks" but none of them worked. I'm so grateful
@sasakiluna3 жыл бұрын
i made the move speed a public float so it is easier to optimize. great tutorial helped a lot.
@dmtuan4 жыл бұрын
It's quite useful to have the ability to assign key bindings in the Inspector in the script. Didn't know you can do that. Thanks!
@lee1davis14 жыл бұрын
Put this in my unity must watch playlist. Great job simplifying this.
@foresking65623 жыл бұрын
9 minute video with 9 minutes of good content. great goob my dude. U made this problem of mine became barelly a inconvenience. NICE
@betterwithlasers4 жыл бұрын
really helpful, the axis swapping was a lifesaver!
@swannschilling4744 жыл бұрын
Thanks for showing how to fix the vector bug...was trying to figure out how, and by luck found your tutorial!!
@AetherXIV4 жыл бұрын
You made the absolute simplest tutorial I've been able to find on this topic. Thank you so much. Would you be interested in making another video, or leaving a comment, on how to add button commands? I know its a "binding" but I can't figure out how to access the bindings I made in my script.
@AsciiKing3 жыл бұрын
Beautifully simple. Thank you so much.
@marc-antoinegirard21784 жыл бұрын
Very helpful tutorial! Actually also helped me with Rewired :)
@dotNets4 жыл бұрын
Keep doing what you do man, you just got a new Subscriber :)
@Devsplorer4 жыл бұрын
Enjoyed and appreciated the tutorial! Thanks :)
@sangeetsargamsagar46393 жыл бұрын
5:58 what exactly is controller.Move() ? Is that a predefined function of the new inputsystem
@RumpledCode3 жыл бұрын
That is a method given by the Character Controller component in Unity :)
@sangeetsargamsagar46393 жыл бұрын
@@RumpledCode oooooooooohhh... Okay... Btw, sir are you on instagram!?
@RumpledCode3 жыл бұрын
@@sangeetsargamsagar4639 I have a company instagram double_lens_vr :)
@Movie-Space_3 жыл бұрын
thats such a good video but i didnt understand when you called the input so i dont now how to make my player to shoot using this plz someone help
@SaSeshen4 жыл бұрын
You are perhaps the only video out there that actually uses mouse movement in their tutorial for the Input System, however I have a couple questions. What is delta vs position for the mouse input? How do I use a system in which it is just a move on click, ie. I right click on the screen and my player moves there? What is the purpose of the Player Controller Component (does it save us some code writing?) I will say this though creating a script that lets you build a custom action map from the editor was something I hadn't seen and is absolutely genius!
@tikokito57784 жыл бұрын
Thank you Bro. Awesome tutorial. simple and good!
@samgraham57313 жыл бұрын
Great tutorial, thanks. Focused and concise. Music was a little distracting.
@29480pete3 жыл бұрын
Can I just ask something? Why didn't you include the tutorial on jumping?
@pliniomourao3 жыл бұрын
Could you add a Part 2 using Mouse Left button, RMB?
@HeadPack3 жыл бұрын
Super valuable. Thank you very much.
@GrenadierPete4 жыл бұрын
Never knew about this technique! Nice!
@klkellychan3 жыл бұрын
I got an error "NullReferenceException: Serialized Object of SerializeProperty has been Disposed", may I ask where did that come from? Thanks!
@supser78273 жыл бұрын
how to make this in a if statement. If pressed c debug.log("hi").
@Movie-Space_3 жыл бұрын
yeah i need help on this too
@mboe943 жыл бұрын
Do you not use the input manager at all? Everything through the script?
@tntclan654 жыл бұрын
I don’t get the wasd input do you know how to fix this 2:05
@4ndresC4 жыл бұрын
Why don't you have to instantiate the InputAction object?
@n8dev4 жыл бұрын
Really great tutorial! Although at the beginning when you use public variables to serialize your values in the inspector, that is actually really bad practice, in OOP you should try to abstract as much as you can; other classes should only be able to see what they need to see, so using [SerializeField] would be much better in this case
@manasjoshi59572 жыл бұрын
Great video man 👌
@Faisal-jo5vk3 жыл бұрын
how do i make it jump?
@tuxdoesstuff3 жыл бұрын
how about for bindings?
@johncardussi4 жыл бұрын
2 questions: 1) The mouse was moving way faster than the keys. To fix that do you create another InputAction for the mouse so you can use a different speed value? 2) Is there a way to redefine the keys so players can customize their controls to say use the arrow keys?
@GwynPerry4 жыл бұрын
I haven't tested this, but when you set up a binding you have the option to add Interactions and Processors. Under the Processors, there are options to scale and clamp the input, amongst others. I'm guessing some combination of these can be used to adjust the mouse sensitivity.
@juten60203 жыл бұрын
I'm lost. This is a great way to use the new inputsystem for movement. However, for normal functions, I'm kind of lost. Could someone help with this? For example, if I wanted to make an attack button, how would I do this?
@jamesflips62133 жыл бұрын
To reference a single button, you first add it to the OnEnable and OnDisable functions just like you did with wasd. In the Awake function, you can write attack.performed += _ => Attack(); this will allow you to create a function that is called when you press the binding for the attack action. For example, if you were to write void Attack(), then you can create a bool called attacked and set it to true in this function. Finally, in the update function you can write: if(attacked) { (attack code) attacked = false; } something like that allows you to have an attack ability, but you'll have to figure out how to write the actual attack code on your own because I have no clue how lol. Hope this helps!
@jamesflips62133 жыл бұрын
nvm its as simple as writing if(attack.triggered) in the update function lmao
@hiddenworlds2254 жыл бұрын
Great video! I know this is a bit off-topic, but where did you get the material for the floor? I see people use it, but I could never find it.
@wadeeliason9694 жыл бұрын
The grid material is from the pro builder asset
@hiddenworlds2254 жыл бұрын
thx. Thought it looked familiar.
@wadeeliason9694 жыл бұрын
Hidden no prob
@rakibulalam2774 жыл бұрын
I did the same thing as you. but when I press w or s it moves along y Axis. Please Help
@videosifoundontiktok92484 жыл бұрын
Can u make search autocomplete System?
@yuukivm3 жыл бұрын
This is the best tutorial :)
@Kilgorio4 жыл бұрын
How to animate player with this?
@AtelierMcMuttonArt4 жыл бұрын
Wait, what? How were you able to alter the finalVector's individual axes in C? Whenever I try that, it throws an error, saying that it can't be modified because it isn't a variable.
@gabrielaguiar59843 жыл бұрын
Input.GetAxisRaw("Horizontal") how I can make this in New input System?(i think is 1D but, im not sure how to use)
@saiverx4 жыл бұрын
I guess I haven't spent too much time staring at my code yet, but my input is only detected for a split second. I dont know what it is that cancels out my input, but I did check the input using the debug.log method and it only detects me holding the button for a few frames/a split second. Any ideas on a fix? I really dont understand what could be causing this, seeing as it is the first line of code inside the Update void...
@saiverx4 жыл бұрын
Here`s the solution: I had set the Action Type to "Pass Through" and not "Value". Setting it to Value fixed it for me. :) Altough it has worked perfectly as pass through but suddenly it stopped working. That's when I sought to a tutorial such as this one to find my error.
@taltra99224 жыл бұрын
Thank you for the video, it is the only tutorial that worked for me. But can you upload your project somewhere? My game prototype works but in the console I get literal hundreds of errors. MissingComponentException: There is no 'CharacterController' attached to the "Input" game object, but a script is trying to access it. You probably need to add a CharacterController to the game object "Input". Or your script needs to check if the component is attached before using it. I checked and there is a controller attached to my object
@nickname99763 жыл бұрын
When I click on the path nothing pops up Pls HELP!
@elinal99854 жыл бұрын
Your naming conventions hurt me
@xLester13x4 жыл бұрын
helped me a lot!
@MrMrMrPresident4 жыл бұрын
Hey, I was wondering about whether you think this input system would be good if you are planning to allow players to rebind keys, or maybe this is only good for prototyping.
@RumpledCode4 жыл бұрын
I'd use it for that, for sure :) I'd say you'd be able to make it relatively easily.
@MrMrMrPresident4 жыл бұрын
@@RumpledCode Awesome! Thanks for the video
@Art_Studio_Figma4 жыл бұрын
i followed your steps .. but still its not moving ...plz help me to solve this
@Erbmon4 жыл бұрын
I mean this takes like 2 clicks and 2 code lines in godot or unreal, why unity why?
@070tahsin4 жыл бұрын
Does this code also work on a android device where you can swipe the player to left and right
@DanA-ux6ow4 жыл бұрын
Yes
@CanCodeyt4 жыл бұрын
I did everything you said and my character is still going upwards
@green0_0204 жыл бұрын
Because in line 19 you need to type OnDisable(). He wrote OnDisalbe()
@CanCodeyt4 жыл бұрын
@@green0_020 ohhhh
@toxicaristotle30524 жыл бұрын
somebody help with crouching to idle animation with the new input system
@FM_GOBi4 жыл бұрын
How do I read a button press on a keyboard?
@RumpledCode4 жыл бұрын
If you want something that is read only 1 frame: inputAction.triggered If you want to read it each frame, read the float value and check if it is greater than 0
@FM_GOBi4 жыл бұрын
@@RumpledCode I've figured it out. (Keyboard.current.wKey.wasPressedThisFrame) This is what I was looking for. Thank you kindly for the video and the comment, I've subbed! :) But this method isn't as responsive as I would like. If I press the buttons very fast, it doesn't update as fast as I am pressing.
@sanzjulio4 жыл бұрын
Does it go along with nav mesh ?
@RumpledCode4 жыл бұрын
I'm not sure how the input system and the navmesh are connected. Could you elaborate?
@sanzjulio4 жыл бұрын
@@RumpledCode i want mY plaYer to recongnize a terrain with a nav mesh navigator . could i add a nav mesh agent to that plaYer.... thanks a lot!!
@RumpledCode4 жыл бұрын
@@sanzjulio Yes but then I assume you'd want your player to be moved by mouse click or some other way of defining an end point for it's movement. So this tutorial isn't really for that. But yes, you can absolutely do it :)
@sanzjulio4 жыл бұрын
@@RumpledCode thank You!!
@RumpledCode4 жыл бұрын
@@sanzjulio Happy to help :)
@MrPrezDev4 жыл бұрын
This is OK method for tiny unimportant projects, but if you have a real game then you would be wise to learn to use the new input system properly.
@toxiq52954 жыл бұрын
My Unity wont show me InputAction so I can type it in but then nothing happen D:
@RumpledCode4 жыл бұрын
Have you added the Input System package from the package manager?
@toxiq52954 жыл бұрын
@@RumpledCode yes I did and I can use it but in the script unity won't use the function InputAction
@RumpledCode4 жыл бұрын
@@toxiq5295 Not sure what the issue is from your comments. Try creating a new project and following along the tutorial step by step.
@toxiq52954 жыл бұрын
@@RumpledCode I made a new project now it works ty probably just deleted something
@RumpledCode4 жыл бұрын
@@toxiq5295 Happy to help :)
@KeeCity4 жыл бұрын
Bravo!!!
@b03tz4 жыл бұрын
I don't think your "OnDisalbe" function will do alot! :)
@RumpledCode4 жыл бұрын
Your opinion is correct :P
@b03tz4 жыл бұрын
@@RumpledCode :D
@prathammittal4 жыл бұрын
Nice :)
@RumpledCode4 жыл бұрын
Glad you liked it!
@Kilgorio4 жыл бұрын
wow
@wadeeliason9694 жыл бұрын
Very helpfull
@paulbunyangonewild75963 жыл бұрын
This! Stuff! Doesnt! Work! Why!
@paulbunyangonewild75963 жыл бұрын
Oh Thank God. FINALY!!! Adding in the enable line made it work.... thank you so much.... even though it feels redundant I can see how it would help developers not have all their control methods active at once. All this time I thought it was just being fussy about the value type and what have you.