How to use the new Input System in Unity3D

  Рет қаралды 39,814

Andy W

Andy W

Күн бұрын

Пікірлер: 184
@christianernord
@christianernord 4 жыл бұрын
One of the most in-depth tutorials I have ever seen, with great coding practices and without unnecessary ums... and uhs... Thank you, This is art in tutorial form!
@CodingWithUnity
@CodingWithUnity 4 жыл бұрын
Thanks a lot! Takes a lot of work to make these, Although its partially because I'm bad at film making :D
@CodingWithUnity
@CodingWithUnity 5 жыл бұрын
Hope everyone enjoys this video on Unity's new input system
@Bankie666
@Bankie666 4 жыл бұрын
I found this a bit confusing because of all the extra fluff. I think it would have worked better if you just had a cube to move around, and maybe a button to make it jump. That would have minimised the number of scripts but kept all the key points.
@CodingWithUnity
@CodingWithUnity 4 жыл бұрын
I dont disagree, video could of been better
@nbpraptor
@nbpraptor 3 жыл бұрын
I am actually glad for the extra "fluff" there are many tutorials that are bare minimum, however not many showing other options of the new input system
@gflhydra
@gflhydra 3 жыл бұрын
I am new to C# coding and unity in general but this tutorial really made it easier for me to grasp the new input system compared to other tutorials, keep up the good work!
@Kalahee
@Kalahee 4 жыл бұрын
Nice video. Thanks for doing it in 2020, because all others use outdated UI and approaches. There is a slightly quicker/better? process for gamepad joystick input at 8:40. Actions + > Movement + > Add Binding > Path : Left Stick (or "/leftStick").
@CodingWithUnity
@CodingWithUnity 4 жыл бұрын
Thanks for sharing that!
@rupeshpandey6603
@rupeshpandey6603 4 жыл бұрын
I wanted to use the new input system and with me being a beginner, This was a bit difficult to understand at first but well 3 days later, I see how cool this is. Thanks so much. I like how you don't write spaghetti code and treat this is a project.
@subliminalcastillo2126
@subliminalcastillo2126 4 жыл бұрын
Thank you for making these! Anybody who's complaining about the length of the video has a short attention span, and isn't showing appreciation for the amount of time & effort you're putting into these tutorials. People with better attention spans get better rewards in life. If you want to dedicate your time to learning something as frustrating & patience demanding as computer programming, you're going to have to take the time to teach yourself how to be patient and sit through a long video. The in depth videos are better than the short ones, because you learn so much more from them.
@nbpraptor
@nbpraptor 3 жыл бұрын
Agreed
@허재욱-b7i
@허재욱-b7i 4 жыл бұрын
This is a really good tutorial for both unity user and programmer. Thanks for the patterns, man.
@davidt.2438
@davidt.2438 4 жыл бұрын
This tutorial was helpful by showing how the input system works in a broader project with interfaces and abstract classes.
@Caldera510
@Caldera510 3 жыл бұрын
Extremely underrated. Carry on, sir.
@csahmet
@csahmet 4 жыл бұрын
Nice to see that usage of command pattern in game, Keep it up.
@CodingWithUnity
@CodingWithUnity 4 жыл бұрын
Thanks a lot!
@usa14j
@usa14j 4 жыл бұрын
Excellent video! You did a great job showcasing what can be done. Liked, Subscribed, and looking forward to watching more.
@CodingWithUnity
@CodingWithUnity 4 жыл бұрын
Much appreciated!
@Arnoldius
@Arnoldius 4 жыл бұрын
Thank you so much for this great tutorial! You deserve so much more subs! Keep it up 👍🏻
@CodingWithUnity
@CodingWithUnity 4 жыл бұрын
Thanks a lot! :)
@zucheenii
@zucheenii 4 жыл бұрын
At 23:50 you created “private IInteractable” and said you made the class earlier but I don’t remember making it, was it in another script?
@SaSeshen
@SaSeshen 4 жыл бұрын
I literally poured over this video so many times looking for it. The only place I found "IInteractable" was in his github for referencing world objects. So I created a namespace, and class that had the interactable name in it and then typed using namespace, at the top which then made the IIinteractable function. But he did not make that at any point during the video.
@pascaljoly1251
@pascaljoly1251 3 жыл бұрын
At 2.19
@Skyefaux
@Skyefaux 4 жыл бұрын
God thank you so much!!!! everyone else suuuuuucked at explaining how to implement this.
@gabrielgomesch
@gabrielgomesch 4 жыл бұрын
This was a very good video!! Besides the new Input System, which seems to be awesome, it was very good to see the application for this command pattern. I never used it, even in web development. Now I am learning Unity by making an strategy game. I already did the hex grid system, but now I was in doubt about how to make an Input module/system. I'm pretty excited to try this new Input System.
@CodingWithUnity
@CodingWithUnity 4 жыл бұрын
Glad you like it! Should work pretty dern good for a strategy game, and if you add in the command processor and an Undo function, it would be super strong
@ximecreature
@ximecreature 4 жыл бұрын
Hello, If you want to be able to edit multiple instances of the same monobehaviour across different GameObjects, using UnityEditor you can add the tag [CanEditMultipleObjects] above your class. Great video, I came to find bits to help me make such an architecture (the most optimal way to do it imo) and ended up finding the whole package. Great video !
@CodingWithUnity
@CodingWithUnity 4 жыл бұрын
Good note! And glad you like it! Theres a slightly more expanded version of it on my github
@zandrewsonnemaker5579
@zandrewsonnemaker5579 4 жыл бұрын
The reason people are finding this confusing isn't that you used this pattern for input, it's because you coded the entire complicated addition you're referencing before hand and just breezed through how it worked like we should all know what you're talking about. If I were you, I would have made this a two part series where first you explain the basics of the new input system, then you go through the pattern and combining the two
@CodingWithUnity
@CodingWithUnity 4 жыл бұрын
Thats a good idea, should of done that. Hindsight is 20/20 tho
@faythe03
@faythe03 4 жыл бұрын
I was looking for such tutorial, thank you.
@CodingWithUnity
@CodingWithUnity 4 жыл бұрын
I'm glad you found it!
@adamodimattia
@adamodimattia 4 жыл бұрын
Wow, I'll just say that it's crazy how good your content is and how few subs you have, I hope and wish that it is just a matter of time. You show really great use of interfaces and coroutines (nice practical coroutine while loops are already shown nicely in the tweens library video). I really appreciate your tutorials, it is a pleasure learning from them.
@cradle_of_chaos
@cradle_of_chaos 4 жыл бұрын
Have you looked into custom interactions in more detail by any chance?
@creminders
@creminders 4 жыл бұрын
Dude, I'm Subscribeing because I love your voice man. Perfect for tutorials 😊❣
@CodingWithUnity
@CodingWithUnity 4 жыл бұрын
Thanks for the sub! And thanks a lot i appreciate that!!
@kurttaratun3210
@kurttaratun3210 4 жыл бұрын
I can't use the using directive "UnityEngine.InputSystem" to access the input system from my scripts folder. Any ideas how to fix?
@FlashBash64
@FlashBash64 4 жыл бұрын
It doesn't seem to let me bind a key when I use an action as a button. It only lets me bind them when I'm using it as a vector2. Any idea what the issue is?
@CodingWithUnity
@CodingWithUnity 4 жыл бұрын
Probably a unity bug, just type the name of the key like an animal. lolol
@FlashBash64
@FlashBash64 4 жыл бұрын
@@CodingWithUnity lol. That worked for the keyboard... but I cant figure out how I would program the right mouse button
@fernandomilans8444
@fernandomilans8444 4 жыл бұрын
Seeing the quality of this video, I can't imagine the skills that you could get with a video explaining the selection of multiple objects with a box selection and with the new input system, could you take it into account for a next video? Thank you!
@guardian3472
@guardian3472 Жыл бұрын
I know im a little late to the party, but Ive been stuck on setting up the MouseAim Action for way to long. mouse postion isnt showing upt as an option. And i some how gorced it to at some point but it was greyed out. Still havent figured out how to get it to i guess "enable" the mouse position as a bindable tonan action
@Romelus3d
@Romelus3d 4 жыл бұрын
Thx man this tutorial helped me , i suggest you to make thoese kind of tutorial shorter cause it can be very hard to digest for some people. Shorter video will be more attractive i think :) ( just divide them in parts!)
@nickprice6644
@nickprice6644 4 жыл бұрын
Great Tutorial - but Hi thanks for the tutorial, but it would have been nice to have had a 'starter download' to follow the session with. I've been looking for a tutorial using this new input system with a UI, but have been unable to find an up to one. Any suggestions please? Thanks & Regards Nick
@afrakes4510
@afrakes4510 3 жыл бұрын
this video is great but you're doing so much at once I can't keep up. good stuff tho. It's a really solid video, but it's less 'How to' and more 'What else'. Still I can't wait until I figure out what I'm doing so I can watch this again.
@andriypostelzhuk8489
@andriypostelzhuk8489 4 жыл бұрын
I didn't get the answers for questions I have about new input system. But still it's a good video with real coding session. Thanks. P.S. Imho classes dependencies and abstractions are designed not really good. There are implicit circular dependencies. And this abstractions are unnecessary here. And this not right use case of command pattern. In fact, this is not command pattern at all! I would rather use just simple C# events here.
@josiahsaunders4936
@josiahsaunders4936 4 жыл бұрын
SUPER detailed! Thank you! Subbed
@CodingWithUnity
@CodingWithUnity 4 жыл бұрын
Glad you enjoyed it!!
@CoderSV3
@CoderSV3 4 жыл бұрын
Sorry if this is a dumb question. However, is the Command script in the Commands Folder autogenerated, or would I have to write one myself along with the other C# scripts you have in there as well?
@rapaltiar
@rapaltiar 4 жыл бұрын
Why didn't you make the properties in the interfaces both getters and setters? why just getters and then setting private setters in the monobehaviour?
@marlkarx2482
@marlkarx2482 4 жыл бұрын
@Coding With Unity the PlayerInputAction is still not showing up even after rewatching and following every step. Is there a fix or any suggestions on what I could do about it
@marlkarx2482
@marlkarx2482 4 жыл бұрын
Actually I fixed that issue but another arose. The _inputAction.Player.Interact.performed is telling me that player is not defined.
@CodingWithUnity
@CodingWithUnity 4 жыл бұрын
Player is the name in the editor window, make sure you named it correctly!
@alejandrodelgadobustos1121
@alejandrodelgadobustos1121 4 жыл бұрын
I can't seem to find mouse position for the binding path (someone plz help)
@CodingWithUnity
@CodingWithUnity 4 жыл бұрын
Mouse.current.position.ReadValue() is how you do it in code if you want an event for when your mouse moves, its the mouse's delta
@NarTheNecromancer
@NarTheNecromancer 4 жыл бұрын
Was going crazy trying to figure out why mouse position wasn't showing up in the binding path dropdown. I had given up and decided to resume the tutorial. But when I set the Action Type and Control Type to Value and Vector 2 I checked again and mouse position then showed up. Not sure why he didn't need to do that first in the video but I hope this helps.
@wtmftproductions
@wtmftproductions 4 жыл бұрын
The way you set up a bool for a button press doesn't work when you actually test it because you can release the button in such a way that the value is never recorded as being less than .15f in this case. Any way to get a true binary of shooting and not shooting, without using a read value? It also doesn't seem to keep "firing" when the button is held down.
@CodingWithUnity
@CodingWithUnity 4 жыл бұрын
I think in the editor window where you create what buttons do what actions, you might be able to play around with those settings to get the result you want
@GoogleDothBetray
@GoogleDothBetray 4 жыл бұрын
I was instantly greeted with a piece of very important information: sir, you get a like and sub from me.
@CodingWithUnity
@CodingWithUnity 4 жыл бұрын
Welcome aboard!
@faythe03
@faythe03 4 жыл бұрын
Cab you provide some tips for making this work with click to move? Mouse click is a float, not a vector2 in the settings.
@CodingWithUnity
@CodingWithUnity 4 жыл бұрын
If you look at my MouseRotationCommand code, on mouse click im reading the position of the mouse and using that position to get the angle for the player. So you can use that code to get the mouse position instead of just a float, looks something like var mousePosition = new Vector3(Mouse.current.position.ReadValue().x, 0, Mouse.current.position.ReadValue().y);
@faythe03
@faythe03 4 жыл бұрын
@@CodingWithUnity Thank you! :)
@humadi2001
@humadi2001 4 жыл бұрын
is this new system good for light 2D Games on Mobile Platforms?
@leofeitosa179
@leofeitosa179 4 жыл бұрын
How do I use d'pad angles in the new input system?
@kippenegg
@kippenegg 4 жыл бұрын
Dang, i get a NotImplementedException from the inputsystem when i click on an action and it wont show the properties of it, i was pretty excited to use this but stuck only 8 minutes in.
@kippenegg
@kippenegg 4 жыл бұрын
Ughh.. guess i have to go back to the old system, kind of disappointing after seeing the potential of this one, it's alright too i guess.
@marlkarx2482
@marlkarx2482 4 жыл бұрын
My thing did not come with any of the thing like the IMove thing. Is there a way to get around this?
@braheem8545
@braheem8545 4 жыл бұрын
I had the same thing. I believe it’s just because they‘ve updated the input system since then, so you’ll have to use the documentation or find a more recent tutorial
@CodingWithUnity
@CodingWithUnity 4 жыл бұрын
IMove is a custom interface i set up, you can get the code from my github!
@jamerach
@jamerach 4 жыл бұрын
Great tutorial, probably :D Completely lost me by reading the code while typing, requires a lot of prior unity knowledge. Thanks for making me not waste time with new unity system :D
@rapaltiar
@rapaltiar 4 жыл бұрын
I have to ask, what extensions are you using for the visual scripting?
@scottpeal60
@scottpeal60 4 жыл бұрын
Got here looking for ECS version of new Input. Any chance you could take this awesome tutorial and convert it to ECS as a follow-up vid?
@CodingWithUnity
@CodingWithUnity 4 жыл бұрын
posssibbbllyyyyy, if we can restrict it to a single worker thread for handing passing the events around it would be much more performant, but spreading it across multiple threads might get hairy
@ravanin
@ravanin 5 жыл бұрын
How would you adapt this for an interaction system? Im thinking of a game that can be controled on point'n'click diablo style, but I would also like to have a more wasd/gamepad controls that diablo has on console. Any tips would be appreciated.
@CodingWithUnity
@CodingWithUnity 5 жыл бұрын
It should pretty much already work for that if I'm not mistaking. Altho I would change how the rotating towards the mouse works, maybe have the character just rotate to face the mouse on click as a base action, then add more functionality on top of that using the commands. Instead of it being based off when you move the mouse and press the button You would just need to add the IInteractable interface to whatever components hold the behaviour of what should happen when you click on it Unless maybe I'm misunderstanding your question?
@SilentscufflE
@SilentscufflE 4 жыл бұрын
uh, can someone show me where IInteractable was created, because I've been watching and rewatching this video for where it was made and it's just not there
@CellarPhantom
@CellarPhantom 4 жыл бұрын
Same, rewatching for the third time now :-) Can't find where we "created it before"
@CellarPhantom
@CellarPhantom 4 жыл бұрын
@Zashiki Warashi I went into his source code on github and found that he made a file here: Assets/_InputTest/WorldObjects/Scripts/IInteractable.cs namespace _InputTest.WorldObjects.Scripts { public interface IInteractable { void Interact(); } }
@SilentscufflE
@SilentscufflE 4 жыл бұрын
@@CellarPhantom I think that's what I did last time as well, since this is like my second time combing through this to make sure I understand it and a previous project had it in.
@ericsanderson2236
@ericsanderson2236 4 жыл бұрын
I dont have PlayerInputActions as an option. Only PlayerInput or PlayerInputManager.
@anou0413
@anou0413 4 жыл бұрын
Incredible video. It may have been better to separate this into different videos and explained each piece in more depth, but I love how you used interfaces and subclasses to better organize/reuse the code. Kudos!
@簡尚澤六家國小
@簡尚澤六家國小 Жыл бұрын
ˋ😂😊😊😊😊😊😊😊😊😊😊😊😊😊😊😊😊😊😊😊😊😊😊😊😊😊😊😊😊😊😊😊😊😊😊😊😊😊😊😊🎉😊🎉😅😊😊😮🎉🎉
@簡尚澤六家國小
@簡尚澤六家國小 Жыл бұрын
😅哥哥跟他😮😊🎉🎉😅🎉😮😅😅🎉😮梯田疼痛哥哥偷偷偷偷泰國蛤蛤蛤哥哥偷偷蛤蛤蛤🎉😮😮🎉🎉
@簡尚澤六家國小
@簡尚澤六家國小 Жыл бұрын
😊😅
@簡尚澤六家國小
@簡尚澤六家國小 Жыл бұрын
😊😊
@簡尚澤六家國小
@簡尚澤六家國小 Жыл бұрын
🎉😊偷偷跟他偷偷的😮臺鐵😊😊
@nocultist7050
@nocultist7050 4 жыл бұрын
Input System makes me feel like I'm working around the system to do stuff the system was supposed to do.
@snooksv3172
@snooksv3172 4 жыл бұрын
Right, like we can't we just have access to the inputs at runtime? So dumb.
@gaming4fun419
@gaming4fun419 4 жыл бұрын
Personally I have a hard time following due to your speech pattern since it is a bit monotonous but it's a brilliantly well thought out tutorial none the less. For me it would have worked better with a bit more conversational tone rather than a presenting one.
@CodingWithUnity
@CodingWithUnity 4 жыл бұрын
Great feedback, ill def take it into consideration on my next vids
@gaming4fun419
@gaming4fun419 4 жыл бұрын
@@CodingWithUnity That reply earned you a like and a sub for at least a couple of future videos. =) I have ADHD so that's why the slow deliberate presentational tone makes it hard for me to fokus.
@shortiez3149
@shortiez3149 5 жыл бұрын
could you make a video on how to make an input system where users can change binds at runtime?
@CodingWithUnity
@CodingWithUnity 5 жыл бұрын
This video shows how to switch the actions that a button does at runtime, and at the end of the video i show a resource for how to do keybinding
@shortiez3149
@shortiez3149 5 жыл бұрын
Oh cool. Exactly what I need
@shortiez3149
@shortiez3149 4 жыл бұрын
@@CodingWithUnity does it allow you to rebind the key for an action or just an action a key does? Great Video btw
@CodingWithUnity
@CodingWithUnity 4 жыл бұрын
@@shortiez3149 the functionality that i show in this video is jsut to change the action of what a button does. But if you go to the unity input system manual, and then go to the "how do i" section, it shows how to rebind keys
@shortiez3149
@shortiez3149 4 жыл бұрын
Coding With Unity ok thanks for the help
@KeyBrute
@KeyBrute 4 жыл бұрын
God the previous tutorials were so outdated that it made me almost slam my pillow
@CodingWithUnity
@CodingWithUnity 4 жыл бұрын
your pillow 🤣
@SaSeshen
@SaSeshen 4 жыл бұрын
Anybody else having an issue where "Position [Mouse]" Isn't even an option no matter how many different ways you search for it? I am in the 1.0.1 version if that makes a difference....
@l3f3v
@l3f3v 4 жыл бұрын
13:30 looking stressed into my assets folder.
@ninjabuntu
@ninjabuntu 4 жыл бұрын
So now that I know how to set up the inputs. I could have sworn I heard that one of the features is the ability to set up rebinding in runtime. How is all that done?
@bndawg2000
@bndawg2000 4 жыл бұрын
If you're looking for rebinding on runtime here is the documentation of it from unity docs.unity3d.com/Packages/com.unity.inputsystem@1.0/manual/ActionBindings.html#runtime-rebinding
@ninjabuntu
@ninjabuntu 4 жыл бұрын
@@bndawg2000 thanks, that helped me out. Been trying to convert my FPC to Input System and want to give players options to set up the controls to their liking.
@TrigenStuff
@TrigenStuff 4 жыл бұрын
what exactly are InputAction. in OnIteractButton() ?
@CodingWithUnity
@CodingWithUnity 4 жыл бұрын
If your referring to the Input Action asset, its just a visual representation of which button perform which actions in your game
@Celldweller02
@Celldweller02 4 жыл бұрын
If your IDE doesnt give you a hint use this UnityEngine.InputSystem.InputAction.CallbackContext
@TrigenStuff
@TrigenStuff 4 жыл бұрын
@@Celldweller02 OMG thanks a lot helped... but why does it work ? xD
@TrigenStuff
@TrigenStuff 4 жыл бұрын
or maybe why does not coding with unity guy does not need using unityengine. input system ?
@deshjview
@deshjview 4 жыл бұрын
Have you experienced any problems on importing the dependencies for the new input system so far? A lot of people seem to have trouble with it, making some a bit weary of using it for now. But then again this system is still on an experimental state...
@CodingWithUnity
@CodingWithUnity 4 жыл бұрын
I had one problem where the listen button wasn't working, but thats it haha
@Mijdax
@Mijdax 4 жыл бұрын
You need to regenerate the csproj in unity preferences i guess
@Armetron
@Armetron 4 жыл бұрын
I was wondering if you could do a video on how to make a 4 player local multiplayer game. I'm stuck trying to get my controllers working on SPECIFIED selectors. Using the default player input will randomly set the controllers to the selectors (my player 3 selector is being controlled by my gamepad 1) I just hate how everyone who does a tutorial on the new Input System just uses the included components. Unfortunately these components are way to simple to do any meaningful work. The included player input manager for "out of the box multiplayer" spawns in a single type of prefab whenever/whichever input device presses a button
@CodingWithUnity
@CodingWithUnity 4 жыл бұрын
Hmm id have to do some test on it, but if i get around to figuring it out ill def make a video on it!
@Sirfy7555
@Sirfy7555 4 жыл бұрын
I dont have the vector2 composite thing... I only have a 1d and some other stuff
@CodingWithUnity
@CodingWithUnity 4 жыл бұрын
can you timestamp the part of the video?
@zandrewsonnemaker5579
@zandrewsonnemaker5579 4 жыл бұрын
Hey so there is a bug where if you hit the plus button it won't show the Vector2 Composite but if you right click the action it WILL show up ​ @Coding With Unity future reference
@SilentscufflE
@SilentscufflE 4 жыл бұрын
How much more difficult would this be if you were to do it for 2D?
@CodingWithUnity
@CodingWithUnity 4 жыл бұрын
Should be pretty much the same id suppose
@SilentscufflE
@SilentscufflE 4 жыл бұрын
@@CodingWithUnity Thanks, yeah. I finally got everything working, I'm sorry I was just frustrated after a full day of thrifting through every possible resource to understand everything all at once. Your tutorial is really good if you're willing to put some extra effort into it. I'm still getting the hang of trying to extend its functionality to other things, like for instance, having a scriptableobject modify the speed settings for the input events. If that's even best practice. I'm trying to learn best practices first and it's difficult to find out where to start or who to trust. Since you're really into sectioning things off, do you think relegating things like player speed should be a function of its input event, since that's where you finally have the player move? Where do you put things like that? How flexible is this kind of system really for getting things to communicate with each other? I'm looking into menus and the like and most people use singletons. It's hard to find tutorials in the style of event-based inputs and neatly modular functionality.
@danh9676
@danh9676 4 жыл бұрын
So using this system I can make AI that doesn't need the mavmesh? I would love to see more elaboration on this.
@CodingWithUnity
@CodingWithUnity 4 жыл бұрын
I mean you can do that with or without this system
@DrFross09
@DrFross09 4 жыл бұрын
I can't follow along I don't have the inputTest folder or any of those files. At this point I really hate that they're making a change to this.
@nicholasnui6630
@nicholasnui6630 4 жыл бұрын
@9:15 I can't stand when people design drop downs like that, especially in the asset import window as well. Not being able to easily collapse all or open individual sections is nightmare fuel for people with minimal screen space.
@sssncodesstuff3364
@sssncodesstuff3364 4 жыл бұрын
One of the videos where you actually get some good advices regarding better architecture, not just how to do this or that somehow. But why are you calling instance of class copy? Its quite confusing - until i've seen you are creating new instance in code actually i have no idea what you mean by "we have to make a copy of that class ve created", there is several names for lot of stuff in programing, but please, don't reneame instance :)
@CodingWithUnity
@CodingWithUnity 4 жыл бұрын
Thats a good question, i probably just said it without realizing it hah :D Your deff correct tho, i should use the correct terminology
@sssncodesstuff3364
@sssncodesstuff3364 4 жыл бұрын
@@CodingWithUnity Anyways good video, keep it up:)
@CodingWithUnity
@CodingWithUnity 4 жыл бұрын
@@sssncodesstuff3364 Thanks a bunch!
@andreasmetz2438
@andreasmetz2438 4 жыл бұрын
Absolutely amazing Tutorial, thank you so much for the effort! However what exactly is the benefit of using the Command Designpattern here? Wouldn't it be easier if you'd just code the Movement Logic into i.e. the OnMoveInput directly? I mean I see that you get loose coupling but at the same time I feel that the readability suffers a bit.
@Mijdax
@Mijdax 4 жыл бұрын
you have a razer keyboard dont you? Thanks for the guide.
@CodingWithUnity
@CodingWithUnity 4 жыл бұрын
I do! I'v considered buying a silent keyboard for making youtube vids with. No problem!
@Mijdax
@Mijdax 4 жыл бұрын
​@@CodingWithUnity I actually like the sound of the clicking. I am currently also testing with this new system. I stumbled upon a few things I dont like about it. First and foremoest the fact that the events dont fire onChange or each frame. So I have to store the performed values. And if I need to find if the button has been pressed just this frame, I have to clean it up again because I cannot access wasPressedThisFrame through the context variable that gets passed through if I am correct. My newest struggle with this is that for instance an action like crouch is done by moving the axis of the left stick down, gives me floating point values to work with, which I have to catch and round through code manually. I thought that the processors are used for this, yet I cannot find any option to do that with it. So all in all I started writing my own PlayerInputHandler that capsulates the PlayerInput that gets generated and handles all the values and stores them in seperate variables (also cleans them up in lateUpdate so I always know when a button is pressing, wasPressedThisFrame or was released this frame... I somehow thought the whole new InputSystem would be a bit more userfriendly. What I actually like about it is that its actually working. Thats something the old inputsystem had trouble with. One example would be that the buttonlayout of the old inputsystem was completely different when using an xbox controller on mac than on PC
@47Mortuus
@47Mortuus 4 жыл бұрын
Subbed just to support someone with an inadequate amount of subs. I personally am intimidated by the new input system. WTH is a "pass-trough Action Type" etc. - it just looks like a lot of spaghetti. The only reasonable... reason to use this new system I heard of is when you want to support multiple platforms and thus control schemes. "Simplicity" is definitely NOT it - so what are some of the reasons you'd give someone? Maybe performance because you're not checking things every frame anymore (does it even save you 1ms?)?
@CodingWithUnity
@CodingWithUnity 4 жыл бұрын
I dont believe it really is that much more performant, because the act of sending out an event on input can get heavier than just checking if the input was pressed that frame. But i suppose id agree with that, the best thing about this system is the ability to swap out the inputs that perform certain actions, and easier key bindings.
@47Mortuus
@47Mortuus 4 жыл бұрын
​@@CodingWithUnity Events are chains of virutal function calls that get way more costly the more you sub to them, yes, but checking for input is accessing some random value in RAM aka 100ish clock cycles per boolean. Whatever ther case, the difference (?) probably doesn't matter in the real world. okay, thanks for answering my question :)
@Kalahee
@Kalahee 4 жыл бұрын
Pass Through vs Value - Value : If mouse and right stick does same action, only one of them will return. If you move mouse left and stick right, pointer will move accordingly to only one. - Pass Through : If mouse and right stick does same action, both are accounted for. If you move as previously said, both direction 2d vector will be summed. It is simpler for having control on which schemes you want activated. Let's say you can go from a FPS to a tactical overview, you can deactivate FPS controls and enable TOV. Other reason for Input Action System is using events instead of updates to trigger actions. Instead of having various methods that read from an input, you callback those methods when input triggers, like UI buttons. It is a different point of view for managing inputs. It sounds harder because we don't have default schemes already available like old input system.
@tenpovine1668
@tenpovine1668 3 жыл бұрын
Maybe just explaining the whole API
@rizingphnx8255
@rizingphnx8255 4 жыл бұрын
A good tutorial, but definitely forgot some crucial pieces of info. You have lines of code referring to objects we probably don't have. Followed your tutorial and have errors exploding all over the place
@id104335409
@id104335409 3 жыл бұрын
Jesus Christ! All I need is a way to move my character forward one space when I press a button with the new input system!
@pattech3960
@pattech3960 4 жыл бұрын
There's still no PlayerInputActions, only these. PlayerInput PlayerInputManager
@bndawg2000
@bndawg2000 4 жыл бұрын
He named his input actions "PlayerInputActions" so whatever you named your input actions is the name of the class
@lee1davis1
@lee1davis1 4 жыл бұрын
I greatly appreciate the tutorial, but the new system is far too much work. I know eventually I'll have to use it, but hopefully the asset store will have a plugin that does all the work for me.
@CodingWithUnity
@CodingWithUnity 4 жыл бұрын
To be fair to Unity, I overcomplicated this more than it needed to be by using interfaces because I was trying to slip in how useful they are without making that the main topic of the video. But in hindsight, I can see how that made everything seem complicated
@SilentscufflE
@SilentscufflE 4 жыл бұрын
@@CodingWithUnity It absolutely seemed complicated. I couldn't figure out why my namespaces weren't working and I was trying to make sure I was putting things in the right folders that you kinda just skipped over (the thoroughness made it seem like it was important to match it exactly) and now that I have everything set up right before "click to trigger debug messages" nothing's happening. I'm okay with being meticulous but you made sure everything was abstracted in the lesson without much overview available to people watching. You have the architecture figured out and at least I sure didn't, that's why I'm here. And now I kinda just wasted five hours and now I have to waste more if I want to figure out what went wrong.
@nGAGE0nline
@nGAGE0nline 4 жыл бұрын
You can refactor your KZbin banner to: Coding = IsUnityOpen(); :P
@fuzzy-02
@fuzzy-02 4 жыл бұрын
Sorry first few minues arent catching
@CodingWithUnity
@CodingWithUnity 4 жыл бұрын
Yeah, i kinda agree the beginning of this video is a bit hard to follow
@Massive-3D
@Massive-3D 4 жыл бұрын
10:45 cheat codes
@CodingWithUnity
@CodingWithUnity 4 жыл бұрын
Lmao
@nikg3392
@nikg3392 3 жыл бұрын
This new input system is so OTT to what I used to do. OMG. NOT user friendly at all.
@k-tech2937
@k-tech2937 4 жыл бұрын
Who thought it was a good idea to make an input system like this? it is so unnecessarily complicated, just have a look at the ue4 input system, it takes 30 seconds to set up. Why can't unity achieve anything on this level of user-friendliness? it can't be that it takes this long to set up something this simple
@CodingWithUnity
@CodingWithUnity 4 жыл бұрын
It's actually really nice and not bad if you used their pre-made stuff, but if you're referring to the extra stuff I did.. then yes it is unnecessary if your goal is a smaller game
@k-tech2937
@k-tech2937 4 жыл бұрын
@@CodingWithUnity it can do a lot, and as a programmer, I love to use it, buuut it is almost inpossible to use for someone who completly lacks programming knowledge. A new user will be overwhelmed with it, which is a shame because the system is actually pretty solid and way more funcional than UE4s system
@k-tech2937
@k-tech2937 4 жыл бұрын
@@CodingWithUnity your tutorial is good, my comment wasnt meant to criticize you
@watercat1248
@watercat1248 4 жыл бұрын
the truth is im confused wan i see this video im not confused for the new input system before that video your methods is to complex for my the only thing i want is to replace the old input system with the new input system way no one it doesn't made tuorial for that ? i know way the new input system is so mach better in meny ways but i dont find haw to work on this system yet the reason i want to use the new input system for meny reasons 1. the dont need to multiply the button if you wat to have more the 1 player for 1 computer 2. he find each controller seperet that mean if watn to if have many controller each of this have different buttons layout is passable to make to work correct for each of this controller 3. the have meny useful tools but i have 1 big negative if same want to change the default button binaries out side in unity the is no way to do that in the new input system
@CodingWithUnity
@CodingWithUnity 4 жыл бұрын
docs.unity3d.com/Packages/com.unity.inputsystem@1.0/manual/HowDoI.html#create-a-ui-to-rebind-input-in-my-game
@watercat1248
@watercat1248 4 жыл бұрын
@@CodingWithUnity ok thenx but i allrey figer oute the basic i thin if find more examples i will eble to change everything in the new system
@Kdghost15
@Kdghost15 4 жыл бұрын
no entendi c:
@eldowado1381
@eldowado1381 4 жыл бұрын
You don't have to change a thing, but I had to stop watching as every sentence sounded like a question - mad anxiety inducing.
@CodingWithUnity
@CodingWithUnity 4 жыл бұрын
One day ill learn how to talk to a microphone ;)
@monkeyrobotsinc.9875
@monkeyrobotsinc.9875 4 жыл бұрын
dude, for future videos, just talk normal. you are using a mix of normal, professional, and valley girl. its really disorienting. and chill with the voice cuts.
@orchard800
@orchard800 4 жыл бұрын
And slooow down! I can't keep up, but so want to.
Transformers (how LLMs work) explained visually | DL5
27:14
3Blue1Brown
Рет қаралды 4,7 МЛН
🎈🎈🎈😲 #tiktok #shorts
0:28
Byungari 병아리언니
Рет қаралды 4,5 МЛН
Who is More Stupid? #tiktok #sigmagirl #funny
0:27
CRAZY GREAPA
Рет қаралды 10 МЛН
Why you should switch to Unity's New Input System (and how easy it is)
9:51
Jason Weimann (GameDev)
Рет қаралды 34 М.
3 Hours vs. 3 Years of Blender
17:44
Isto Inc.
Рет қаралды 7 МЛН
The BEST Mechanical Display You've EVER Seen!!
13:51
Tin Foil Hat
Рет қаралды 612 М.
How I learned Unity without following tutorials (Developing 1)
18:11
Game Maker's Toolkit
Рет қаралды 2,1 МЛН
How do non-euclidean games work? | Bitwise
14:19
DigiDigger
Рет қаралды 2,5 МЛН
10 Signs Your Software Project Is Heading For FAILURE
17:59
Continuous Delivery
Рет қаралды 43 М.
OAuth 2.0 and OpenID Connect (in plain English)
1:02:17
OktaDev
Рет қаралды 1,8 МЛН
🎈🎈🎈😲 #tiktok #shorts
0:28
Byungari 병아리언니
Рет қаралды 4,5 МЛН