Unity Input System Demystified: 3 Easy Workflows You Need to Know

  Рет қаралды 2,798

git-amend

git-amend

Күн бұрын

Пікірлер: 66
@git-amend
@git-amend 13 сағат бұрын
Happy Sunday! I hope this video clears up any confusion about Unity's Input System-let me know your favorite workflow or if you have any questions below!
@cryostorage1578
@cryostorage1578 13 сағат бұрын
I've been working with the input system for a while now and never actually bothered to read past the wall of config to get to those interfaces lmao. Very informative, thanks!
@git-amend
@git-amend 13 сағат бұрын
Awesome, glad to hear that!
@jagobian
@jagobian 10 сағат бұрын
Amazing video as always! Would love to see a follow-up video on displaying input actions using the UI Toolkit and reacting to input device changes to update the bounded input actions.
@git-amend
@git-amend 9 сағат бұрын
Great suggestion!
@fleity
@fleity 8 сағат бұрын
I agree that this would be very useful. The input visualizer from the samples is nice, but having a nice and styled UI which shows the user the current inputs has proven incredibly useful in our current project (for the users themselves and the devs debugging, we show it on-screen during video captures of playtests to get an idea of what the user did)
@sima19995
@sima19995 9 сағат бұрын
Using a Scriptable Object for the Input Reader is genius! Never would've thought of that!
@git-amend
@git-amend 9 сағат бұрын
Great, hope that tip proves useful!
@davearvelo
@davearvelo 8 сағат бұрын
This is great! After watching several other tutorials, only one mentioned the C# class, but your video offers a lot more depth and gave me a much better understanding. Thanks for all the insights!
@git-amend
@git-amend 32 минут бұрын
Awesome, thank you!
@정동우-n2x
@정동우-n2x 29 минут бұрын
I didn't know there was a way to make things like this. It's really amazing. Personally, I wish your Unity tutorials could be published as a book. Something like "Unity for Advanced Users." I study a lot with official Unity projects, but teacher(your) projects are always a step above.
@git-amend
@git-amend 18 минут бұрын
Thanks for the kind words!
@정동우-n2x
@정동우-n2x 2 минут бұрын
@@git-amend I also hope to one day develop my own code rather than just cloning teacher's code, but it's really challenging. Thank you for your great tutorials as always. However, what I want to ask is, I don't quite understand why "use Isolated Input Action" needs to exist. I don't understand why it has to be "only responding."
@Dan-i2q7l
@Dan-i2q7l 5 сағат бұрын
I've been using the Scriptable Object approach ever since I saw Unity's Scriptable Object Architecture video. I'm a university student, and have only been using Unity since October, I really enjoy your videos (although sometimes they're a little complex for me)!
@git-amend
@git-amend 34 минут бұрын
Thanks, and glad to hear it. We're going to have a video on SOAP coming up in a few weeks!
@Q.Roo_0
@Q.Roo_0 7 сағат бұрын
I planned to just watch this video for my own entertainment without expecting to learn anything new but I ended up learning about a c# feature I did not know of at 2:50.
@git-amend
@git-amend 30 минут бұрын
Nice, which feature was that?
@CollinPatrick
@CollinPatrick 6 сағат бұрын
There is also another workflow that allows you to subscribe directly to the individual input action assets. It's like the Interface/SO approach, but on a per-action basis.
@silchasruin4487
@silchasruin4487 12 сағат бұрын
Glad to see the channel growing! The Input system has always been a chore and a source of frustration for me. Especially when updated features will randomly break your workflow and cause bugs. This is great as a source for a tighter more streamlined work process to navigate. Thanks a ton for this!
@git-amend
@git-amend 12 сағат бұрын
Thank you and you're welcome!
@prometheus1100
@prometheus1100 6 сағат бұрын
Great video! Definitely will check out those interfaces. I'm currently using your Event Bus to raise input events on a singleton InputManager. Using the interfaces to generate those methods will save some time wiring things up, thanks!
@git-amend
@git-amend 33 минут бұрын
Fantastic!
@suntonio7187
@suntonio7187 13 сағат бұрын
Awesome! I didnt look into it too much because I always felt the prototyping is easier with the "old" system. Glad I can somehow use the "better"/"newer" system without the hassle and overload it seemed to imply. Direct reading FTW ^^
@git-amend
@git-amend 13 сағат бұрын
Yeah, the direct read is very convenient for that!
@midniteoilsoftware
@midniteoilsoftware 9 сағат бұрын
Very good overview. I like the way you abstracted the input allowing consumers to either subscribe to events that you forwarded on or properties. I actually got into a bit of a flame war following that very pattern in my Joust tutorial. Their primary hangup was that we basically have "a subscription within a subscription". i.e. you have a middle-man that's receiving the events from the input system forwarding those with events of its own. I actually made a follow-up video on abstracting user input explaining why that's a good thing.
@git-amend
@git-amend 31 минут бұрын
A little abstraction never hurt anyone. I'm often surprised at how many game developers shy away from it, and from patterns like Facade.
@fleity
@fleity 8 сағат бұрын
Very very nice. Input reader as SO is hot. - I'd like to add that the samples for the input package are super useful, i.e. there is button remapping already in there.
@git-amend
@git-amend 32 минут бұрын
Yes, I agree with that - all the samples are very helpful!
@nwsl-7i
@nwsl-7i 12 сағат бұрын
Thanks for the great videos as always. from south korea.
@git-amend
@git-amend 12 сағат бұрын
Thanks for watching!
@GlasTaibhse
@GlasTaibhse 10 сағат бұрын
solid tutorial! I've been using the scriptable object approach for a while and it's great if you want separate maps for different Input States (like on foot, in a vehicle, etc or KBM vs Controller). really helps only sending input data to only the current object you're controlling. Also I just got Rider after watching your vids the past few months, I am absolutely loving it and it's a huge upgrade from VS 2022, especially with hlsl cus it actually formats properly instead of being a jumbled mess in VS
@git-amend
@git-amend 9 сағат бұрын
Thanks for the comment! Rider is awesome, I'm really glad you enjoy it! I should have mentioned the shader support in my vid!
@michaelwilson8461
@michaelwilson8461 4 сағат бұрын
Thanks for the work you put in on these videos, some really helpful insights. I started using Unity just a short time before the Input system was released (or maybe just before I became aware of it?) anyway... I definitely am not a fan of change myself, so I understand the reservations people have about moving from one method of doing things to another, especially if you have a lot of experience with the current way of doing things. However I do find the new system to be pretty intuitive (after an initial learning curve) , I find it to be easier for me when it comes to supporting multiple input devices , just seems a little cleaner over all IMO.
@git-amend
@git-amend 34 минут бұрын
You're welcome, and I agree 💯
@rutchjohnson
@rutchjohnson 13 сағат бұрын
Happy Sunday! Thanks for the vid
@git-amend
@git-amend 13 сағат бұрын
Same to you!
@TheMystogrigen
@TheMystogrigen 13 сағат бұрын
I create my own input reader. I create a ScriptableObject that I can store input action references in. I then throw that ScriptableObject into a custom input reader with some public methods that check the references when called. And finally I can check that input reader for inputs like the old input system. I keep swearing that I will swap over to the event version, but I'm lazy, and this works.
@git-amend
@git-amend 13 сағат бұрын
Interesting approach, and not too different from the 3rd workflow. I often prefer polling over events, especially for things like movement.
@ahmedmohammedfahmy5093
@ahmedmohammedfahmy5093 11 сағат бұрын
Great one as always 🎉 Would u consider doing some XR stuff in the future?
@git-amend
@git-amend 11 сағат бұрын
Thank you! Might do some XR down the road, might be a good excuse to break out my HTC Vive again... or upgrade.
@vSwaize
@vSwaize 9 сағат бұрын
Great Video!
@git-amend
@git-amend 9 сағат бұрын
Thanks, I'm glad you liked it!
@hop3studio511
@hop3studio511 13 сағат бұрын
Haven't watched yet, but i can tell this is what i need, thanks
@git-amend
@git-amend 13 сағат бұрын
Awesome!
@dragonsnackproductions
@dragonsnackproductions 12 сағат бұрын
I have 5 characters with separate inputs. This will come in handy and your previous video as I get some input calls after new scene load with newest 2022.3 LTS. Is say I should Dispose()...preety sure after creating new inputs I disable them in OnDisable. So yeah... have to search for a solution ;) Happy Sunday thank you!
@git-amend
@git-amend 12 сағат бұрын
Interesting. Maybe take a look at the Unity 'Warriors' sample project. It's a few years old, but it was a demo for handling 5 different inputs at the same time. github.com/UnityTechnologies/InputSystem_Warriors
@dragonsnackproductions
@dragonsnackproductions 11 сағат бұрын
@git-amend thank you so much! Will do!
@Athomield3D
@Athomield3D 13 сағат бұрын
Never been this early lol. Also I never found a reason to use the new Input System but maybe this tutorial will serve as good introduction. Thanks !
@git-amend
@git-amend 13 сағат бұрын
Nice work! I hope you try it out! A little more complex, but hopefully this video makes it easy!
@dragonsnackproductions
@dragonsnackproductions 13 сағат бұрын
Happy Sunday! I have to go back to one of your videos on how to close/disolve supposedly non active input calls. Or ...I'll watch the video for answers here now ❤
@guillem99
@guillem99 12 сағат бұрын
Nice video! The only disadvantage I see with this approach is not being able to access the InputReader from non-MonoBehaviour scripts.
@git-amend
@git-amend 12 сағат бұрын
That's true. If necessary, you might want to just implement the interfaces as pure C# classes and serve them up from a Service Locator or DI, which would also be convenient.
@damonfedorick
@damonfedorick 13 сағат бұрын
Nice!
@git-amend
@git-amend 13 сағат бұрын
Thanks!
@jackieczech1777
@jackieczech1777 12 сағат бұрын
As always, great video! Thanks a lot Adam! In my case I just don't know if it's ok to set the input package to Process Events in fixed update, then I have consistent input (50Hz) and synchronization with physical simulations for controlling the player via Rigidbody2D (with Interpolation). Is it okay, or can there ever be a problem with that? In my case everything works very smooth and properly. But, you always read input in update and transfer logic of physical movement into fixed update with Rigidbody, far as I saw in your videos? :)
@git-amend
@git-amend 12 сағат бұрын
You're welcome. Your approach is very interesting, I've never seen anyone do that before so I don't have a solid answer for you. I tend to store the value in Update because I'm often using it in other systems and not just for moving the character. For example, I set my blend value for the characters locomotion animation based on the movement input. So, I think the answer to your question is probably 'it depends'... or maybe 'if it works, it works!' Very interesting scenario.
@SmittyBandoleros
@SmittyBandoleros 12 сағат бұрын
Great Video! i want to ask where do you call the EnablePlayerActions? and i have a problem where i need to enable domain reload for it to receive input when you run it for the second time, do you have a solution for this? thank you!
@git-amend
@git-amend 12 сағат бұрын
Thank you. I usually enable the actions from my player controller in the Start method. As for your second question, I don't think I've ever experienced that issue, so maybe another subscriber has some advice or maybe it's a question for the Unity forum. Or Discord.
@christopher6886
@christopher6886 9 сағат бұрын
Which workflow do you tend to use and why do you prefer it over the other options?
@git-amend
@git-amend 9 сағат бұрын
I prefer the 3rd option with the Scriptable Object as it gives the most flexibility and is scene independent.
@ladylexxieblack
@ladylexxieblack 11 сағат бұрын
You are by far my favorite channel on KZbin when it comes to coding. You and Sebastian Lague are the best
@git-amend
@git-amend 11 сағат бұрын
Wow, thanks! That is too kind!
@jake-ly
@jake-ly 6 сағат бұрын
I love the new input system for its flexibility, but they really messed something up in Unity 6. For some reason inputs just stop working and require an editor restart every couple hours.
@git-amend
@git-amend 33 минут бұрын
Interesting, I have not experienced this myself (not yet at least)
Using Octrees and A* for Efficient Pathfinding
31:22
git-amend
Рет қаралды 10 М.
Expression Trees in Unity: The SECRET to Flexible Game Logic
14:50
Chain Game Strong ⛓️
00:21
Anwar Jibawi
Рет қаралды 41 МЛН
When you have a very capricious child 😂😘👍
00:16
Like Asiya
Рет қаралды 18 МЛН
Catching up with async Rust
17:55
fasterthanlime
Рет қаралды 28 М.
Why Can't We Make Simple Software? - Peter van Hardenberg
41:34
Handmade Cities
Рет қаралды 185 М.
The Power of Scriptable Objects as Middle-Men
17:41
samyam
Рет қаралды 132 М.
Netflix Removed React?
20:36
Theo - t3․gg
Рет қаралды 69 М.
Revolutionize Your Unity Game with Optionals and Monads
14:59
Fix Closure Issues in 10 Minutes and Boost Performance
11:41
git-amend
Рет қаралды 6 М.
Building a Graph of AO3 Relationships
17:04
very much tom
Рет қаралды 69 М.
Using and Customizing Unity's NEW Behavior Graph
22:47
git-amend
Рет қаралды 28 М.
Chain Game Strong ⛓️
00:21
Anwar Jibawi
Рет қаралды 41 МЛН