Why You Should Use The New Input System In Unity + Overview

Поділитися
Вставка
  • Опубліковано 8 вер 2024

КОМЕНТАРІ • 122

  • @unicaegames
    @unicaegames 3 роки тому +22

    The new system has really been a blessing for a beginner game dev like me. Even though some of its syntax seems a bit weird at first. The ability to easily enable / disable different control schemes, which all support multiple input devices, when I need them is just so good!

  • @aNoobAllDay
    @aNoobAllDay 3 роки тому +54

    I was learning to code for some years and then they spring the new input system on us and I felt overwhelmed by it, I didn't even want to take time to learn it, but I decided to give it another chance. You deserve more Subs.

    • @samyam
      @samyam  3 роки тому +2

      Thank you! Glad you decided to learn it 🙂

    • @personmuc943
      @personmuc943 2 роки тому

      1 year later, Is it worth the learning effort? I haven't started learning the system yet And I want to know how it went with you.

  • @user-pg5sz2vn1w
    @user-pg5sz2vn1w 7 місяців тому +1

    i learned how to use the new input system via unity events through some tutorials recently and i love it.
    it seems confusing at first but now that i get it, it seems so straight forward. i wasn't planning on making my game multi platform but now i don't see any reason not to,

  • @elinal9985
    @elinal9985 3 роки тому +5

    At first it was annoying to set up, but after using it for a week I like it a lot more than the older one.

  • @HappyMatt12345
    @HappyMatt12345 3 роки тому +16

    From my experience, the new input system seems a lot more intuitively designed than the input axis system we're all familiar with, at least in my opinion. If you're reading this and haven't already switched to using the input system, I recommend you do, it saves a pretty good amount of time and frustration.

    • @Jaypordy
      @Jaypordy 3 роки тому

      Can you get the key code of the connected device mapped to specific action programmatically? ex. 'Jump' has 'Space' on KB and 'X' on pad bound. If KB is connected, can the respective Key(space) of the action jump be printed on UI without having a separate implementation?

    • @samyam
      @samyam  3 роки тому

      In the case of this video, you need to specify a binding that you want to override. So, I’d say you could change the script so that it first checks what device is connected, which the player input component sends out an event when the device has been switched, and depending on the device choosing a different binding index. To make it easier for yourself you can assign the first index of each control to the keyboard device, and the second to the controller. If not you’d have to search each action’s bindings to determine what device they correspond with.

    • @cozycr8485
      @cozycr8485 3 роки тому

      @@samyam How do you reference input interactions you made in the input system in your code? I'm incredibly confused about it. Or how to make the inputs correlate with things actually happening.

    • @samyam
      @samyam  3 роки тому

      You add a PlayerInput component and reference that component in your script, and you can access the actions. You can read the values from the actions or subscribe to their events. In my third person shooter video I show how to use the Player Input component and read the input action asset values in code
      ua-cam.com/video/SeBEvM2zMpY/v-deo.html

  • @blackivy011
    @blackivy011 2 роки тому +8

    Dude can I just say that you rock. Easily the best explanation of the new input system by far over any other youtuber. Even Brackeys. I've been binge watching your stuff and it's awesome. Not to mention, you do Unreal engine 5 as well which I was learning before this. Now I can use your videos for both! Thank you SO MUCH for doing these videos even though they don't "blow up" on views, they are extremely helpful for people that are lucky enough to find you and you deserve soooo many more view. I will subscribe and recommend you. Thanks

    • @samyam
      @samyam  2 роки тому +2

      Thank you so much!! That's a very nice comment and I very much appreciate the support :) I'm still learning Unreal but hopefully I can do tutorials on it in the future!

    • @blackivy011
      @blackivy011 2 роки тому

      @@samyam Looking forward to it my friend.

  • @wes5457
    @wes5457 3 роки тому +1

    The best tutorial i see in all youtube .

  • @neuni232
    @neuni232 2 роки тому

    THANKS FOR THIS VIDEO! I never noticed, that the new Input System is so good. I'll never use the old one again!

    • @samyam
      @samyam  2 роки тому

      Yay!!! Glad I helped 😄

  • @SteadyPaceVince
    @SteadyPaceVince 3 роки тому

    You are one of the best out there, your videos are underrated, keep up the good work!

    • @samyam
      @samyam  3 роки тому +1

      Thank you so much!

  • @fredqq2003
    @fredqq2003 Рік тому

    I am not a native English speaker, but I can still understand this video, thanks!
    Hope you can make some videos for melee fighting game in Input System
    thanks for your videos

  • @rflx3608
    @rflx3608 3 роки тому

    thank you i finally understand this new input system i just recently came back after a year tho

  • @user-wg1jk6xe1m
    @user-wg1jk6xe1m Рік тому

    great great vid. thank you always for the precious information. Next video I would love to see is maybe which touch system I should use, e.g. either 'Enhanced Touch' or touch screen in 'New Input System'. I see most of your videos uses 'New Input System' instead of Enhanced Touch. This decision could be crucial decision points for mobile game.

  • @marinhobrandao
    @marinhobrandao Рік тому

    Very good and useful video! I will watch all the others. Thank you!

  • @RedP1ggyBank
    @RedP1ggyBank Рік тому

    Your videos are very helpful and concise. Thank you!

  • @ewwitsantonio
    @ewwitsantonio 3 роки тому

    Awesome video!! So glad I came across your channel. You made a great case here - I'm def gonna jump in and try the new system for the next project.

    • @samyam
      @samyam  3 роки тому

      Great to hear!

  • @sarphusgaming3542
    @sarphusgaming3542 3 роки тому +2

    I think the reason they deploy the new input system as a package is that you have to disable the old one when you install the new one. Your project will break if your project is using the old one. That said, I think it's worth upgrading any project that uses the old one.

  • @wtflolomg
    @wtflolomg 3 роки тому +7

    I ripped out InControl from my game and replaced everything with the New Input System... so much better. I spent a lot of time building my configuration screen, but it was nice to see a Logitech Extreme 3D flight stick work out of the box after using my game's configuration screen to bind the joystick's unique inputs to game actions. I also discovered the default input controls I was using for the UI stuff handled the flight stick's joystick for navigating menus, but the trigger was not being used Submit - no problem... I copied the package's default input asset and added the new binding.
    Did you know you can use multiple assets at the same time? In my case, I segregated the Gamepad, Mouse, Keyboard and Joystick (well, 'everything else') into their own assets and I use them all in my game loop. Saving and loading the custom rebinds is simple.
    I would like to see better joystick support, and an ability to add more paths to cancel rebinding operations, but so far I am very pleased.

  • @toongenie
    @toongenie 2 роки тому

    video convinced me to at least give it a try, thank u for the very thorough overview of its features

  • @MrZuchiS
    @MrZuchiS 3 роки тому +1

    Great video as always, thank you so much for this. I've been really hesitating to learn this new input system because of how daunting it is at first, but I'm feeling more motivated now :D
    The only doubt that I still have though is how to change the bindings in play mode and persist it, so the player is able to change the default bindings to their like. If you could point me out to any resource explaining this, I will be forever grateful hehe

    • @samyam
      @samyam  3 роки тому +2

      Yay! I have a video on that :)
      ua-cam.com/video/csqVa2Vimao/v-deo.html

    • @MrZuchiS
      @MrZuchiS 3 роки тому

      @samyam Oh my... you are unstoppable hahahaha officially a fan now 😅

    • @samyam
      @samyam  3 роки тому

      Thank you 😄

  • @Apicurieux
    @Apicurieux 3 роки тому

    Great explanation for a new great system! Thanks a lot and keep making videos, you deserve 100k subs ;)

    • @samyam
      @samyam  3 роки тому

      Thank you so much!!

  • @harrison298
    @harrison298 3 роки тому

    Thank you! Glad to hear that it will be worth all the effort.

  • @GiPa98
    @GiPa98 3 роки тому

    loved this video, super clear. Nicely done and thank you

    • @samyam
      @samyam  3 роки тому

      Thank you!

  • @virtualmaestro6893
    @virtualmaestro6893 3 роки тому

    Hey! You can try to do another challenge. It should work for the mouse and touch.
    If you do click/tap, it has to perform one action (it doesn't matter what), and if you press and move, it has to do another action (like dragging).
    I've found it not so easy (not straightforward ), but especially to detect "touch up" after the dragging (just the tap is easy).

    • @samyam
      @samyam  3 роки тому +1

      I’ve done a swipe detection tutorial which is similar
      ua-cam.com/video/XUx_QlJpd0M/v-deo.html

  • @AndrewMaksymBrainNectar
    @AndrewMaksymBrainNectar Рік тому

    Hopefully this solves the problem I've been wrestling with on my old input system not connection the "jump" button to its code.

  • @gamermanhd5594
    @gamermanhd5594 3 роки тому +3

    I like more the old input system I found it more easier. I like the if(Input.Get) i found it more easier. The new input system allows this if statements?Btw good tutorials you are making a really good work

    • @samyam
      @samyam  3 роки тому +1

      You can do that with the new system too! And thank you!
      docs.unity3d.com/Packages/com.unity.inputsystem@0.9/manual/Migration.html#unityengineinputgetkeyhttpsdocsunity3dcomscriptreferenceinputgetkeyhtml

    • @gamermanhd5594
      @gamermanhd5594 3 роки тому

      @@samyam ty

  • @jumpjumpdiegaming
    @jumpjumpdiegaming 2 роки тому

    I’d love to see a video about using the Input manager, local multiplayer and how to reinstantiate players across scenes (say with a character selection screen -> fight scene).

    • @samyam
      @samyam  2 роки тому +1

      I have a video on local multiplayer here:
      ua-cam.com/video/g_s0y5yFxYg/v-deo.html

    • @jumpjumpdiegaming
      @jumpjumpdiegaming 2 роки тому

      @@samyam I saw this one! Your videos are amazing. My main issue is anything more complex than the most basic implementation of the input manager. How do you keep reinstantiating the player over and over without adding a new player input? If the input managers detects another player input, it assumes it’s a new player. So odd!

    • @jumpjumpdiegaming
      @jumpjumpdiegaming 2 роки тому

      I think you also did a really nice video on a cursor for gamepads in the UI. I was wondering how this could be used for multiple players?

  • @henningerhenningstone691
    @henningerhenningstone691 3 роки тому

    1:46 I don't think anyone has ever jumped with the A key on PlayStation 🤔*bigthonk*
    Jokes aside, great video. I might give the new input system a try, so far I've always disregarded it as "can't be bothered, probably won't need". Also didn't know about the input debugger!

    • @samyam
      @samyam  3 роки тому

      It’s a great system! Not perfect but so far has great features.
      I have a video on the Input Debugger if you are interested :)
      ua-cam.com/video/ICh1ZEaVUjc/v-deo.html

  • @GreenGnoblin
    @GreenGnoblin 2 роки тому

    very nice video. You got a new sub

    • @samyam
      @samyam  2 роки тому

      Thank you!

  • @enriquebergua3276
    @enriquebergua3276 3 роки тому

    Amazing work, thank you

  • @davidpak271
    @davidpak271 3 роки тому

    Thanks for the great video!

  • @alamrodriguezolmos2723
    @alamrodriguezolmos2723 3 роки тому

    Thank You! I love your videos

  • @nilbellmunt9821
    @nilbellmunt9821 3 роки тому

    The content is so complete an useful!

    • @samyam
      @samyam  3 роки тому

      Thank you!

  • @arsil_
    @arsil_ 3 роки тому

    Awesome video as always

  • @venus159
    @venus159 4 місяці тому

    Hi, do you know how to use the new input system and localization together?

  • @CanalDojogames
    @CanalDojogames 3 роки тому

    Thanks god, unity is now like unreal 4 that gives you a lot of things ready, it easy the process and acelerate also save you time because you focus on what is important: make an world,stages,make your game..

  • @Portiexc7
    @Portiexc7 Рік тому

    Ok so, there is no any improvements on input latency side? I would definitely switch to new input system for 10 - 20 ms input latency improvements

  • @SnakeEngine
    @SnakeEngine 2 роки тому

    Isn't it prone to mess up your order of execution? When are those action-delegates called in the gameloop?

  • @id104335409
    @id104335409 3 роки тому +2

    Why are some basic features like that (obviously very helpful) not a part of Unity? Unreal Engine gives its users ready controls attached to the player. (Got frustrated and installed Unreal which reminded me that little fact)(then got frustrated with Unreal a day later and uninstalled it)

    • @samyam
      @samyam  3 роки тому +1

      Yeah that’s one thing Unity can work on making their packages part of the engine without installing extra stuff. Unreal can be pretty frustrating as well 😂 But Unity is working on more tutorials and having more samples ready. They also have a Character Controller component.

  • @aadityakiran_s
    @aadityakiran_s 2 роки тому

    So if you wanna do longPress for example, you have to register finger down and then start a coroutine to detect longpress and stop the coroutine on finger up is it? I want to longpress but I don't want to make it happen if I keep pressing and moving. So how to do that?

  • @chrheca
    @chrheca 3 роки тому +1

    1:50. Minor thing, but the PlayStation doesn't have an A key. You meant X key which is the bottom one out of the 4 colored keys.

    • @samyam
      @samyam  3 роки тому +1

      Yes! I forgot to add a note about that in the video, i was confusing xbox and ps controllers

    • @HappyMatt12345
      @HappyMatt12345 3 роки тому

      I mean, when it comes down to it, they're practically the same thing, so yea.

    • @wtflolomg
      @wtflolomg 3 роки тому

      There are aliases in Gamepad for A, South, 'X' (the shape)... the system does recognize Xbox, DualShock, and Switch Pro schemes. I've been working for a couple of weeks on updating my game with this new system, part of my effort was to use different icon fonts, based on what your controller type is. If you have a DualShock, for example, you'll see 'O' instead of 'B' buttons. The new system is very flexible for this, and my code to detect what type of gamepad you are using was very straightforward.

  • @Mike-rt2vp
    @Mike-rt2vp 3 роки тому

    I wonder if this could be used with an input buffer for fighting and action games...

    • @samyam
      @samyam  3 роки тому

      Yeah you can definitely use this input and create your own input buffer

  • @EnderElohim
    @EnderElohim 2 роки тому

    i dont understand first 2 minues of it because same thing can be done with old input syste too. For example if you use "jump" that mean on keyboad space and on controller A button for example and you can handle them also without going to code just with input manager too. Soo how it is a new feature again?
    4:37 that is not objectively better though. I think old system have better control overall. You dont need to fill your update with stuff that bad programming. You can create function for per action and use them in update aka HandleMove, HandeJump

  • @watercat1248
    @watercat1248 2 роки тому

    the problem with the new input system is that have 0 customization oute site off the unity editor the other problem the have is the don't support there'd party controllers you if have i there'd party controllers im able to add the there'd party controller i the unity and to set up the button for the specific for those controllers but if Saman use i different controllers for those i have set up in the new input system i will not work at all
    in the old input in each i will in the windows input method this means i will support ever controller by default
    because off thos problems i have to create completely new input system that use combination for the old and new input system and to have combination in the old and new Input system in my game in my i want to have bindings system in the order every one to by able to change the default button layout no matter if the play with controller or keyboard and in my opinion to have the option to changes the button layout on controllers is more important for keyboard because like I said earlier each controller have the own way the set up the buttons and on top off that controllers have way lees button for for keyboard keys that means that technically is easier

  • @bitcode9612
    @bitcode9612 3 роки тому

    Thanks you ....

  • @sirpanpan5377
    @sirpanpan5377 3 роки тому

    Thank you, I was about to ask this question on Reddit

  • @jedoncarter8570
    @jedoncarter8570 3 роки тому

    How do you switch action maps and disable control schemes using this method? Switch between maps for player/ui toggle controls and disable control schemes for lets say controller and a keyboard plugged in but I only want the controller to receive input

    • @samyam
      @samyam  3 роки тому

      If you are using the PlayerInput component you can use the function SwitchCurrentActionMap(...) to switch action maps:
      docs.unity3d.com/Packages/com.unity.inputsystem@1.0/api/UnityEngine.InputSystem.PlayerInput.html#UnityEngine_InputSystem_PlayerInput_SwitchCurrentActionMap_System_String_
      And to use specific control schemes, you can set binding masks to filter between bindings
      docs.unity3d.com/Packages/com.unity.inputsystem@1.0/api/UnityEngine.InputSystem.InputActionMap.html#UnityEngine_InputSystem_InputActionMap_bindingMask
      forum.unity.com/threads/how-can-i-set-a-specific-control-scheme-at-runtime.750461/
      forum.unity.com/threads/how-to-disable-specific-control-schemes-on-device-change.818886/

  • @karkeeravindran3649
    @karkeeravindran3649 3 роки тому

    Hello...
    Pl help as soon as possible.
    Tried a 2D game,
    Find the difference game.
    Touching d screen on d object it triggered and result correct, and if touched background image it triggers and results wrong.
    Placed d pointer down.
    If we touched the object, since the pointer moving towards we touched, it automatically triggers the bg first and then the object.
    Results - first msg as wrong, immediately correct.
    How to overcome this. Sonce bg image is 2dboxcollider even if we increase z axis, it collides .
    Can we directly switch(jump) to the touched point without passing through the bg image area.

    • @samyam
      @samyam  3 роки тому

      I’m not exactly sure what you mean but you can move whatever object you need to directly to your touch input point

  • @bobaman8957
    @bobaman8957 2 роки тому

    Ok then what is the more fast way(for better performance )
    Using old on or new one?
    Plz reply 🙏

    • @samyam
      @samyam  2 роки тому +1

      I don’t know the exact measurements, but you should have to worry about the performance difference for input, if you are having performance issues it’s probably because of something else in your game. You can always benchmark/profile it to see which one runs faster (the new one might be a bit slower because it’s doing a lot of stuff in the backend, but it makes input so much easier to handle in the long run).

  • @darkdoom907
    @darkdoom907 2 роки тому

    I wanted to use the old input system for testing a package, How can I do that?

    • @samyam
      @samyam  2 роки тому +1

      Edit>Project Settings>Player>Active Input Handling
      Switch to either the old one or Both

  • @ravanin
    @ravanin 3 роки тому

    how would you implement that wait for for hold that's so common in UI. What I mean by this is: you press down and it goes down one menu entry. But if you hold down it first goes down then after a second it starts going down one element at a time.
    This behaviour is also useful for grids.

    • @samyam
      @samyam  3 роки тому

      I’m not sure what you mean, but the UI should work the same with the new system, you just need to convert it in the Event System gameobject.

    • @ravanin
      @ravanin 3 роки тому

      @@samyam hmmm you konw how when in a menu you can't really move ultra fast over the menu entries cause it would become unusable? so instead it has a way to move one entry everytime you push the arrow keys. and if you hold the arrow keys it moves one entry then after a small delay selects the next one , so on and so forth.
      This is alsousable on tactics games like x-com when you move trough the grid.
      Basically what the repeater class does in this link: theliquidfire.com/2015/05/24/user-input-controller/

    • @samyam
      @samyam  3 роки тому

      @@ravanin Ah okay I see what you mean. I don't think the input system has direct support for a custom time. The interactions they provide have a hold time and press point but not a delay between a hold. There is a multi tap delay time but that's for tapping multiple times not holding. You'd be best off implementing that with a simple coroutine that gets called when you start pressing down the button and yield wait the amount in seconds before continuing down the menu.

  • @frisk1780
    @frisk1780 3 роки тому

    Can you make a tutorial on ECS?

    • @samyam
      @samyam  3 роки тому

      Perhaps in the future! Got a lot of stuff planned for the near term :)

  • @a.technology1446
    @a.technology1446 3 роки тому

    U r amazing 🔥👍

  • @rizalalfandi1235
    @rizalalfandi1235 3 роки тому

    Nice

  • @sparx7747
    @sparx7747 Рік тому

    Hi there,
    can some one tell me what it means " +=_=> " .
    I'm not very good in coding and I'm confused about this " +=_=> "
    I know "+=" which is for subscribing and "-=" when unsubscribe functions . but I don't know about this "+=_=>" !?

    • @samyam
      @samyam  Рік тому +1

      it’s an anonymous event handler, so you can extract the parameters of what’s being returned in the event and handle what to do with them, in this case I don’t care about the return value so I put an _ as a placeholder. But be aware it’s not as easy to unsubscribe from this event and it might leak some memory, you would need to hold a variable for the reference to the delegate to unsubscribe.
      stackoverflow.com/questions/183367/unsubscribe-anonymous-method-in-c-sharp
      riptutorial.com/csharp/example/335/anonymous-event-handler-declaration

    • @sparx7747
      @sparx7747 Рік тому

      ​@@samyam Thank you so much for quick response :)
      this link is really helpful to understand "delegates" and "anonymous functions"

  • @darkfuji196
    @darkfuji196 3 роки тому

    Oh great, this saves me from having a massive global dictionary attached to everything that can be controlled.

  • @JOHNSMITH-sj3lg
    @JOHNSMITH-sj3lg 3 роки тому

    how to use 2d animations with the new inputsystem?

    • @samyam
      @samyam  3 роки тому +1

      I have two videos here that may help:
      How to Set Up an Animator Controller with Sprite Sheets - Unity Tutorial
      ua-cam.com/video/1Ll1fy2EehU/v-deo.html
      Animator Controller Scripting - Unity Tutorial
      ua-cam.com/video/3Ad1wr3qBRw/v-deo.html

    • @JOHNSMITH-sj3lg
      @JOHNSMITH-sj3lg 3 роки тому

      @@samyam thank you so much

  • @labanikhanam1055
    @labanikhanam1055 11 місяців тому

    samyam you beat poly mars in ai horror game

  • @sidbell929
    @sidbell929 3 роки тому

    Does it make it any easier to allow players to change the default controls?

    • @samyam
      @samyam  3 роки тому +1

      You can define your own set of default controls, then at runtime users can easily change them.
      docs.unity3d.com/Packages/com.unity.inputsystem@1.0/manual/ActionBindings.html#runtime-rebinding
      Dapper Dino also has a great video showing this m.ua-cam.com/video/dUCcZrPhwSo/v-deo.html

    • @sidbell929
      @sidbell929 3 роки тому

      @@samyam Brilliant - Thanks!

  • @Tymon0000
    @Tymon0000 3 роки тому +1

    new input system vs rewired

    • @samyam
      @samyam  3 роки тому

      Sorry I haven’t used Rewired 😔 You can test the new input system out and see if you like it!

    • @Tymon0000
      @Tymon0000 3 роки тому

      @@samyam yea, I will test both

  • @holographicSquid
    @holographicSquid 3 роки тому

    Subway should contact you

    • @samyam
      @samyam  3 роки тому

      Subway? xD Why so

    • @holographicSquid
      @holographicSquid 3 роки тому

      @@samyam cus they should be sending subs your way.

    • @samyam
      @samyam  3 роки тому

      😂😂😂

  • @belleluze
    @belleluze 2 роки тому

    What's a buron?!

  • @Mike-rt2vp
    @Mike-rt2vp 3 роки тому

    Buddin

  • @Gatitasecsii
    @Gatitasecsii 2 роки тому

    honestly. It seems like a pain in the butt. I just don't get it...

  • @crossoutplayer8822
    @crossoutplayer8822 3 роки тому +1

    rarely i see a woman that makes games . I wonder how samyam looks in real life ?

    • @samyam
      @samyam  3 роки тому +1

      I have a video on my channel where I show my face 😳

  • @kozmobotgames
    @kozmobotgames Рік тому

    Is it possible to make my player jump in Unity with the new Input System? If yes, how can I do it?