Unity's New Input System: The Definitive Guide

Ойын-сауық

In this video, I cover everything regarding Unity's New Input System. I walk you through how to actually implement this system as well. It is a bit longer of a video, but it is the most thorough out of all the videos I have seen as well. I started out not knowing how to even use it, to know only using this to control my game. Hope you all enjoy it, and let me know what you would like to see next.
Website: dcmillea.com

Пікірлер: 150

  • @lennykeil8861
    @lennykeil88619 ай бұрын

    Youre literally the first person on this site ive found, that explains this package in enough detail and coherently enough, that id call this an actual guide/tutorial. Youve got the right mindset keep it up.

  • @DmanGames

    @DmanGames

    9 ай бұрын

    Thank you for the kind words. I’m glad this helped!

  • @JohnZyski

    @JohnZyski

    3 ай бұрын

    I wanted to say this same thing. It isn't even in the books I have. Thank you.

  • @mrnickhox
    @mrnickhox13 сағат бұрын

    You deserve a million bucks for this video, Unity should be paying you, this is great! Precise explanation, great attitude, funny and relatable little mistakes added in at the end, not overwhelming or boring at all, thorough enough while leaving space for exploration on my own, and just, such a likeable personality! This video is awesome, and you seem awesome as well. Keep bringing us videos, and keep being you.

  • @Xo1ot1
    @Xo1ot18 ай бұрын

    As someone pointed out before, this is the first information source I've found that explains the whole process in sufficient detail. I've been stuck for days trying to add two new animations you can activate per button presses to a 3rd person starter asset character. Thanks for the vid.

  • @DmanGames

    @DmanGames

    8 ай бұрын

    I’m glad this video was able to help

  • @danielmarchant8727
    @danielmarchant87274 ай бұрын

    Only 5 mins into this video and felt the need to comment that I loved how straightforward and clear you're making this seem! thanks

  • @DmanGames

    @DmanGames

    4 ай бұрын

    Thank you!

  • @devanmauch7843
    @devanmauch78437 ай бұрын

    You're a life saver...not even the Unity docs made this much sense lol

  • @DmanGames

    @DmanGames

    7 ай бұрын

    Thank you, this tutorial took some time to put together

  • @andrehufschmid
    @andrehufschmid9 ай бұрын

    This video provides one of the most comprehensible explanations I've come across. It effectively highlights the distinctions between the choices without causing any confusion by constantly switching between them.

  • @DmanGames

    @DmanGames

    9 ай бұрын

    Thanks for the positive feedback!

  • @MatruKrupabhakti
    @MatruKrupabhaktiАй бұрын

    Brother ! You are really awesome at making new guys understand these comprehensive contents so nicely! Thank you "If you can make it understand to a 6 years old that means you have really understood it well"- Albert Einstein

  • @rpamungkas13
    @rpamungkas135 ай бұрын

    You are a very good teacher. I really struggle to understand the concept of the new input setting and how to use it from other tutorials.. This video make it so easy to grasp. thnx!

  • @DmanGames

    @DmanGames

    5 ай бұрын

    Thank you for the comment, glad to hear it helped

  • @hunterbanks3746
    @hunterbanks37465 ай бұрын

    This is literally the only time this has made sense to me thank you for this tutorial

  • @DmanGames

    @DmanGames

    5 ай бұрын

    Glad this helped!

  • @Gyozamang
    @Gyozamang10 ай бұрын

    hey this was honestly great work and one of the most thorough and easy to understand new input system tutorials I've seen. I've got this bookmarked because i'm sure i'll use it again in the future. Thank you !

  • @DmanGames

    @DmanGames

    10 ай бұрын

    I appreciate that, thank you. Glad this helped

  • @davestrides
    @davestrides21 күн бұрын

    amazing tutorial, you answered all the questions i had. really thorough, thanks man

  • @El-Meowblo
    @El-Meowblo4 ай бұрын

    This is an excellent guide, thank you! I highly suggest adding youtube chapters to it to split the content into easily referenced sections

  • @DmanGames

    @DmanGames

    4 ай бұрын

    That’s a good idea!

  • @HexedDev
    @HexedDev9 ай бұрын

    This was a very good video, I've seen a ton of unity tutorials and yours didn't leave me with any questions, thank you very much !

  • @DmanGames

    @DmanGames

    9 ай бұрын

    No problem! I’m glad this was able to help you

  • @stilwell9895
    @stilwell98955 ай бұрын

    Needed this, thank you for explaining the system instead of just blurting out code for people to copy

  • @DmanGames

    @DmanGames

    5 ай бұрын

    Glad it was able to help!

  • @jamesbryan123troll
    @jamesbryan123troll5 ай бұрын

    Damn, I shouldn't have judged the book by its cover. This is super informative and helpful, hope more people see this video! Thank you for your time creating this

  • @DmanGames

    @DmanGames

    5 ай бұрын

    Glad this helped!

  • @leonardozecchini802
    @leonardozecchini802Ай бұрын

    Great video man. Super clear

  • @pawelpozoga
    @pawelpozoga3 ай бұрын

    Very good explanation. Thank you.

  • @futureapocalypsee
    @futureapocalypsee3 ай бұрын

    Thank You DmanGames for this video, it was perfect from start and to the end !

  • @TroyKrieg
    @TroyKrieg9 ай бұрын

    This video saved my game and my computer. Thanks!!!

  • @DmanGames

    @DmanGames

    9 ай бұрын

    Hahah, happy to help!

  • @isai306
    @isai3065 ай бұрын

    This was a great tutorial. So in depth and great examples.

  • @DmanGames

    @DmanGames

    5 ай бұрын

    Thank you!

  • @iker.rzgz1
    @iker.rzgz14 ай бұрын

    really helpful video, i couldn't find a way to use the new input system properly and u explained it really well, thanks for this :D

  • @DmanGames

    @DmanGames

    4 ай бұрын

    Glad this helped!

  • @varcel4625
    @varcel462520 күн бұрын

    That is very indeepth tutorial. Keep on good work, it really is amazing.

  • @CayawareGames
    @CayawareGames9 ай бұрын

    Using C# events instead of everything else may come in handy when you have more than one hero character or different hero controllers may implement only a subset of available abilities (or when you have a mind control kind of spell which allows you to take over random enemies). In this case, recreating the event handling scheme can be tedious, hence the code only solution.

  • @DmanGames

    @DmanGames

    9 ай бұрын

    Good point, I didn’t really touch up on the C# events, might have to make a follow up video.

  • @BecomingTheFalcon
    @BecomingTheFalcon5 ай бұрын

    I've been hesitating to switch from the legacy input system because everytime I've seen the new one explained it seems so convoluted and like just a major headache to setup. This video is the first time I've understood why anyone likes it, and I'll definitely be making the switch on my next project now. Thanks for this.

  • @DmanGames

    @DmanGames

    5 ай бұрын

    Glad this helps!

  • @WeissberV
    @WeissberV8 ай бұрын

    I actually was using the old input system because when learning Unity a year and a half ago somehow I came across tutorials for the old one and not the new one... When it came to getting to coding rebindable keys it was clear it wasn't going to be as easy as other engines I've experienced and found that apparently there was a new input system this whole time that evaded me, lol. So many tutorials on the new system have been bad for me as they seem to only really focus on the standard 4 way axis of moving a square around instead of simply "press a button and function runs" and they somehow end up getting ridiculously complicated for such a simple task, especially considering how easy the old system is. Your tutorial was by far the most indepth and actually easiest one to follow, thanks!

  • @DmanGames

    @DmanGames

    8 ай бұрын

    Thank you, after sticking with Unity for over a year, I may have to explore other options

  • @datnguyenanh7160
    @datnguyenanh716010 ай бұрын

    So easy to understand !!!! Thank you so much for the great video

  • @DmanGames

    @DmanGames

    10 ай бұрын

    Thank you for the kind words, glad it helped!

  • @Kingdlee_
    @Kingdlee_9 ай бұрын

    Goat tutorial 🎉 I’ve watched a lot on the input system and you are by far the best. Great work

  • @DmanGames

    @DmanGames

    9 ай бұрын

    Thank you, I appreciate it! Let me know if there are other tutorials I can do

  • @Kingdlee_

    @Kingdlee_

    9 ай бұрын

    @@DmanGames you should honestly do a tutorial series like a full 3rd person or fps controller with your tips and tricks. Compared to the other unity guys your already a step ahead in teaching capabilities and a series will give you multiple videos to plan and execute 🫡

  • @DmanGames

    @DmanGames

    9 ай бұрын

    That’s a great idea, and thank you for the kind words!

  • @subhajitghosh9933
    @subhajitghosh99338 ай бұрын

    There is a huge chance you could be the next Brackeys if you could do more tutorials like this. I don't want short half assed tutorials,i want long detailed explanations like this one ! Please keep it coming.

  • @DmanGames

    @DmanGames

    8 ай бұрын

    Thank you! Trying to get better and will have some more game dev videos in the planning. Let me know if you have any ideas

  • @user-rd2dy4bs4h
    @user-rd2dy4bs4h5 ай бұрын

    You are literally the Saint🙏Your explanation is the clearest, thank you!!

  • @DmanGames

    @DmanGames

    5 ай бұрын

    Happy to help! @randomuser

  • @octaviotastico
    @octaviotastico8 ай бұрын

    Nah this is literally the best explanation ever about this input system, thanks man!

  • @DmanGames

    @DmanGames

    8 ай бұрын

    Glad this helped! Thank you!

  • @sztamjan866
    @sztamjan8664 ай бұрын

    Insanely underrated vid, thanks m8

  • @DmanGames

    @DmanGames

    4 ай бұрын

    Np! Tamjan!

  • @JustinS06
    @JustinS063 ай бұрын

    Youve earned yourself a sub Great tutorial!

  • @DmanGames

    @DmanGames

    3 ай бұрын

    Thank you

  • @moci_laci
    @moci_laci6 ай бұрын

    Thank you for this great tutorial. This helped me a lot. 👍

  • @DmanGames

    @DmanGames

    6 ай бұрын

    Glad it helped!

  • @Jaysinxe
    @Jaysinxe8 ай бұрын

    Thank you so much bro, really helped me understand this!

  • @DmanGames

    @DmanGames

    8 ай бұрын

    Glad this helps, let me know what other types of videos you want to see

  • @andrew29375
    @andrew2937510 ай бұрын

    Great video! Very Informative!

  • @DmanGames

    @DmanGames

    10 ай бұрын

    Thank you Andrew!

  • @nurrocode
    @nurrocode5 ай бұрын

    New Subscriber here! I really like how you explain it, it's really easy to understand. wish that you make more tutorial video like this.

  • @DmanGames

    @DmanGames

    5 ай бұрын

    Thank you, glad it helped!

  • @kajak8979
    @kajak897910 ай бұрын

    Very easy to understand, ive watched couple tutorials before and they didnt event mention most of this stuff!

  • @DmanGames

    @DmanGames

    10 ай бұрын

    Thank you! With this tutorial I tried to give simple examples and explanations for each feature.

  • @kajak8979

    @kajak8979

    10 ай бұрын

    @DmanGames also, my character seems to loose speed when walking long enough, do you might know what's the issue?

  • @kajak8979

    @kajak8979

    10 ай бұрын

    nvm figured it out, putting a physics material 2d to the rigidbody with 0.0 friction worked

  • @DmanGames

    @DmanGames

    10 ай бұрын

    Glad you were able to figure it out, good job!

  • @matheusserruya7360
    @matheusserruya73608 ай бұрын

    This video should really have more views. I've finally understand the Unity's New Input System. It's The Definitive Guide indeed!

  • @DmanGames

    @DmanGames

    8 ай бұрын

    Thank you! This vid took a while, unfortunately Unity is up in flames rn…

  • @matheusserruya7360

    @matheusserruya7360

    8 ай бұрын

    @@DmanGames It really is sad what's going on :/

  • @DmanGames

    @DmanGames

    8 ай бұрын

    Unreal is tempting

  • @matheusserruya7360

    @matheusserruya7360

    8 ай бұрын

    @@DmanGames you who knows more, would say unreal is good for 2D too?

  • @DmanGames

    @DmanGames

    8 ай бұрын

    Not great for 2D, but the 3D games you can make are remarkable

  • @musabkara1684
    @musabkara16846 ай бұрын

    Just check if you keep posting new videos. Happy to see you are still here. Nice videos. keep sending :)

  • @rapth
    @rapth5 ай бұрын

    This is literally the best tutorial i found on the new input system, thank you so much for explaining everything in detail Also i am a visual learner so images helped me a lot

  • @DmanGames

    @DmanGames

    5 ай бұрын

    Glad it was able to help! The visuals I drew up help me understand it better as well.

  • @der-Dritte

    @der-Dritte

    5 ай бұрын

    Does onmove(Vector2 input) work ​@@DmanGames

  • @DmanGames

    @DmanGames

    5 ай бұрын

    Yes

  • @der-Dritte

    @der-Dritte

    5 ай бұрын

    @@DmanGames I tried did not work with a character controller

  • @DmanGames

    @DmanGames

    5 ай бұрын

    It’s hard to say what is wrong when I can’t look at it, I will be posting an overview video of it later today with more detailed tips

  • @gameaudioshaman
    @gameaudioshamanАй бұрын

    well done. thx mate

  • @bradleywood1984
    @bradleywood19842 ай бұрын

    I appreciate the walkthrough you've put out for this. I'm curious why a developer would ever want to use the event or C sharp event systems. Is there a reason for selecting these? Like a common use case?

  • @martinhadland5937
    @martinhadland593710 ай бұрын

    Great job man!

  • @DmanGames

    @DmanGames

    10 ай бұрын

    Thank you, let me know if you want me to tackle any other Unity topics!

  • @martinhadland5937

    @martinhadland5937

    10 ай бұрын

    Great stuff man, Do a 2.5D platformer? Cant find any good ones on KZread. Cheers@@DmanGames

  • @DmanGames

    @DmanGames

    10 ай бұрын

    That is an interesting game concept, let me look into it, might make a steam game out of that genre, Brainstorming begins…

  • @dawnsky7
    @dawnsky712 сағат бұрын

    Good Job !

  • @averagecrow1264
    @averagecrow12642 ай бұрын

    THANK YOU!!!!

  • @bastion6421
    @bastion64219 ай бұрын

    it was extremely helpfull

  • @DmanGames

    @DmanGames

    9 ай бұрын

    Glad this was able to help you

  • @ExtremeCrashCam
    @ExtremeCrashCam9 ай бұрын

    How would you use the Player Input component to move left and right continuously while holding the keys? I can only keep moving if I repeatedly tap the key with your method. I ended up applying the input vector with Addforce in Update but there has to be a better way to do it right?

  • @DmanGames

    @DmanGames

    9 ай бұрын

    Gathering the data from the method/event, then applying the new data in the update method isn’t a bad way to do it, in fact it’s probably the most common way.

  • @dgepho

    @dgepho

    9 ай бұрын

    Thanks for the video, Dman. Really thorough guide. I learned a lot. I hope it's okay if I mention how I resolved that issue. Here's how I did it (I'm new to Unity, so take it with a grain of salt): I kept the Behavior in the Player Input component as Send Messages, and then instead of making a WASD composite in the Input Actions, I made 2 actions for each individual WASD key. So for example, for moving left (A key), I made one action called Left and one action called LeftButtonRelease. For the LeftButtonRelease, I set the Trigger Behavior to Release Only under Interactions(Press). So in the script for the OnLeft() function I assigned a boolean to true, which happened when the A button was pressed, and for the OnLeftButtonRelease function, I made that boolean variable false. Then in the Update function if the variable was true (pressed), it would call my move-left function MoveLeft() {rb.velocity =Vector2.left * moveSpeed.}, and when it was false (released), it wouldn't be called.

  • @DmanGames

    @DmanGames

    9 ай бұрын

    That is another way of doing it, and can lead to a performance boost because you don’t have to run all that code when the bool is false. Good response, the input system can work in a bunch of diff ways.

  • @ace-kz9zd
    @ace-kz9zd4 ай бұрын

    Thanks so much for the great video. Im getting an error though. When i generate the PlayerControls script, which i named PlayerActions, i get the error CS0523: struct member 'PlayerActions.PlayerActions.m_wrapper' of type 'PlayerActions.PlayerActions' causes a cycle in the struct layout. Any idea what this error might be coming from? Thanks again!

  • @DmanGames

    @DmanGames

    3 ай бұрын

    Is anything else named PlayerActions in your project?

  • @bluerichi
    @bluerichi10 ай бұрын

    Today i installed unity and worked with the old input system. It won't be abe to process the commands , i was feeling frustrated and disappointed , having self-doubts , thanx man for making me understand that things have changed..

  • @DmanGames

    @DmanGames

    10 ай бұрын

    Glad this video was able to help! Let me know if you have any Unity related issues I can solve

  • @CubaseAcademy
    @CubaseAcademy8 ай бұрын

    Great tutorial, well presented. Thank you. *you should have way more subscribers!

  • @DmanGames

    @DmanGames

    8 ай бұрын

    Thank you for the kind words! Glad this helped, lmk what other topics you want to see covered

  • @iamdaniel471
    @iamdaniel471Ай бұрын

    the movement system doesn't work in 3d mode. and no it was not because i have a 2d rigid body in the script or on my player model. And the jumping does work for some reason. but just the forward, backwards and sidewards doesn't work.

  • @JGCD21
    @JGCD21Ай бұрын

    Can you make a 3d version?

  • @subirin96
    @subirin966 ай бұрын

    I got a question. Why is it that when I use "private PlayerControls playerControls;" the script says that "the value is never read" even though I already create void Start with "playerControls" below it. I initially use my own name when creating Input Action but I tried coding new script with same word for word as yours but still face this issue.

  • @subirin96

    @subirin96

    6 ай бұрын

    I tried with public on both PlayerControls and RigidBody and it works. Why is it so?

  • @DmanGames

    @DmanGames

    6 ай бұрын

    If your code is the same as mine then I don’t think the code is the issue. PlayerControls is the action map, so in your project tab try dragging the input action map called PlayerControls onto the PlayerInput slot on your player. Let me know if that still doesn’t fix it.

  • @DmanGames

    @DmanGames

    6 ай бұрын

    And make sure you have the player input component on your player

  • @subirin96

    @subirin96

    6 ай бұрын

    @@DmanGames I restarted unity and visual script and everything works normally. I just assume it is a bug. Love the videos.

  • @DmanGames

    @DmanGames

    6 ай бұрын

    Glad you were able to solve it, yea sometimes I encounter weird errors and restarting sometimes works

  • @Rochus_Turris
    @Rochus_Turris4 ай бұрын

    Why doesn't the character keep moving when the arrows are pressed?

  • @DmanGames

    @DmanGames

    4 ай бұрын

    Because it needs to be applied in the update method

  • @simplicity3060
    @simplicity30604 ай бұрын

    Why can’t I hold to move???

  • @DmanGames

    @DmanGames

    4 ай бұрын

    You can hold to move, just save your input as a vector and in update or fixed update multiply it by a speed and deltatime

  • @dogame5
    @dogame55 ай бұрын

    Hey, can you create a tutorial on how to use these methods on a 3D Game with Vector 3

  • @DmanGames

    @DmanGames

    5 ай бұрын

    I might do one, although all you need to do is set the y axis for the z axis so instead of moving vertical, you move forward

  • @dogame5

    @dogame5

    5 ай бұрын

    @@DmanGames ok and how can I jump with another key?

  • @DmanGames

    @DmanGames

    5 ай бұрын

    Use the spacebar and make it a button

  • @dogame5

    @dogame5

    5 ай бұрын

    @@DmanGames but my controller doesn't have a spacebar :D i would like to use the square button

  • @DmanGames

    @DmanGames

    5 ай бұрын

    If you have a controller you want to use as input 1. go to the input action asset 2. go under your specific jump action 3. Add a key binding to that action 4. Set it to the square button, or which ever one you choose

  • @gonzalobelen6003
    @gonzalobelen60032 ай бұрын

    love u

  • @klaus117gaming
    @klaus117gaming9 ай бұрын

    10:25 made me laugh 😂

  • @LuzuVlogsGamer
    @LuzuVlogsGamer10 ай бұрын

    Arent C# Events 10x times faster than Unity events? For performance thats why people use delegates or c# events.

  • @DmanGames

    @DmanGames

    10 ай бұрын

    That’s a good point, C# events are faster than Unity events. I have never experienced performance draw backs using any of the new input system methods, but if your games performance is not up to standard, definitely do all that you can for optimization such as use C# events instead of Unity events. Good call.

  • @gregoryfenn1462

    @gregoryfenn1462

    10 ай бұрын

    Is it really as much as that? I would have though Unity Events are just wrappers and a bit of metadata over C# events behind the scenes?

  • @DmanGames

    @DmanGames

    10 ай бұрын

    That’s a good question, from what I found, the base C# events are faster than the Unity Events. I believe it is basically just wrapping and more data is used for each Unity event in contrast to the basic C# events. I am not too versed in the specific details between each, but the C# events are faster than Unity Events. I have never had to deal with performance issues of using any one of these, so I haven’t had to dive too much into this discussion of performance over types of events. In conclusion, the C# events are faster than the Unity events. However, the performance has never been troublesome for me.

  • @TheDiegoPayne

    @TheDiegoPayne

    9 ай бұрын

    @@DmanGames lol, chatgpt here

  • @DmanGames

    @DmanGames

    9 ай бұрын

    Hahaha

  • @waterproofwaterbottle8369
    @waterproofwaterbottle83695 ай бұрын

    ActionMap Input : Create action map and create actions... enable 'Generate C# Class' ! add 'Player Input' Component to Player -Add Input Action Asset -Select Default Map -Set Behavior to: SendMessages In Script : using UnityEngine.InputSystem; private NameOfGeneratedC#Class input in awake: input = new NameOfGeneratedC#Class(); private void OnActionName(InputValue input) { input.get(); } -InputValue only if there is one present

  • @DmanGames

    @DmanGames

    5 ай бұрын

    You’re a saint

  • @waterproofwaterbottle8369

    @waterproofwaterbottle8369

    5 ай бұрын

    I am the saint. @@DmanGames

  • @joaquinillo_
    @joaquinillo_2 ай бұрын

    This was all fine and dandy until I tried to get a OnButtonUp replacement, sorry new input system but I won't touch you ever again, I don't even want to add controller support to my games so why would i bother

  • @godmode3611
    @godmode36114 ай бұрын

    I dont think it is a good idea to assign callbacks in inspector because 1) It is hard to find for other developers. 2) If the method name changes the reference is lost. 3) It is better to have tons of actions in code than in inspector. 4) Changes in code are more friendly with version control than prefabs and scenes are.

  • @DmanGames

    @DmanGames

    3 ай бұрын

    I like it because it is easy to read and more beginner friendly. The code is more effective.

  • @nadavulitsky6450
    @nadavulitsky64505 ай бұрын

    how to check if someone isn't pressing a button?

  • @DmanGames

    @DmanGames

    5 ай бұрын

    Go to the input action map, go to the action you want to check whether pressing or not, and the right tab where there is a plus symbol, click it, and select press and release, that way it triggers when you end the click

  • @nadavulitsky6450

    @nadavulitsky6450

    5 ай бұрын

    is there any other way without changing it because i want to ckeck when i press it and when i am not@@DmanGames

  • @DmanGames

    @DmanGames

    5 ай бұрын

    The steps above wouldn’t change the logic, and tell me which version you are using, send messages, broadcast, Unity events?

  • @nadavulitsky6450

    @nadavulitsky6450

    5 ай бұрын

    im using send massage and also in the right there are two options with a plus and none of them has a press and release option@@DmanGames

  • @DmanGames

    @DmanGames

    5 ай бұрын

    Could you elaborate a bit mote

  • @Fugal-vv1bz
    @Fugal-vv1bz25 күн бұрын

    istg bro you sound like anakin skywalker

Келесі