How to use Unity's Input System

preview_player
Показать описание
How to use the new input system in Unity! I go over installing the package, the different ways to use the input system, and the recommended way!

ᐅGet the full Source Code Bundle to my Unity Tutorials 🤓

📥 Get the Source Code 📥

►🤝 Support Me 🤝

🔗 Relevant Video Links 🔗
ᐅALL of my Input System videos
ᐅInput System Documentation
ᐅInput System Changelog (features and fixes in different versions)
ᐅMigrate From Old Input System
ᐅUnsubscribe Lambda Event Handler Stack Overflow Discussion

This video goes over installing the Input System via Unity's Package Manager, creating an Input Action Asset and assigning an action map, making several actions of different Action Types and assigning multiple bindings to each, mentioning Interactions, Processors, and Control Schemes available, Generating a C# class from the Input Action Asset and referencing it in code, subscribing to the different events that the actions send (started, performed, cancelled), getting the values from the actions directly, using the PlayerInput component to get the values instead (lots of nice helper functions here), assigning an InputAction through the Inspector along with getting a reference to an existing action through an InputActionReference (you can also reference a map!), creating actions dynamically through code, using the Input Debugger to see your actions at runtime, and going over the Migrate from Old Input System guide that Unity posted.

Disclosure: This post may contain affiliate links, which means we may receive a commission if you click a link and purchase something that we have recommended. While clicking these links won't cost you any money, they will help me fund my development projects while recommending great assets!

😎 Cool Unity Assets 😎

►⏱️ Timestamps ⏱️
0:00 Install
1:18 Intro
1:51 Input Action Asset
3:57 Value vs Passthrough
4:20 Assign Binding to Action
4:40 Input System Events (Started, Performed, Canceled)
5:16 Multiple Bindings to Action
5:43 2D Vector Composite
7:42 Interactions
8:34 Processors
8:57 Modifiers
9:17 Control Schemes
10:12 Generate C# Script Overview
11:48 Generate C# Script Usage
18:30 PlayerInput Component
23:24 Event Lambdas
24:39 Enable UI for the Input System
24:54 Input Debugger Short Preview
25:08 Migrate From Old Input System
26:29 InputAction & InputActionReference
27:30 Dynamic InputActions through Code
30:30 Outro

💖💖THANK YOU TO ALL MY PATRONS 💖💖

❯❯❯ My Links ❮❮❮
💗 Patreon 💗
💬 Discord Server 💬
🐦 Twitter 🐦
📚 Facebook 📚
🎵 Music 🎵
Fretless by Kevin MacLeod
👍 Like and Subscribe! 👍

🖥️ Computer Setup 🖥️
*As an Amazon Associate I earn from qualifying purchases.

#unity3d #unitytutorial #unity2021
Рекомендации по теме
Комментарии
Автор

Seriously these input tutorials are the highest quality I have seen on youtube. Blowing my mind with how clear everything is to me now!

Dailyfiber_
Автор

I have seen a lot of input system tutorials but this tutorial is by far the best overview I have seen. You did a really good job showing all the options available and laid out your opinions very well on each of them.

Thank you for putting in the time to make this! It will be my new go-to-video suggestion for people learning the new input system.

alexleonardkrea
Автор

I would like to tell you that these are amazing, while almost every other youtuber simply goes through the process of setting it up and using different unity components, you actually explain them and the logic behind each and every thing, thank you!

maazadnan
Автор

I gotta say, thank you so much for your indepth tutorial that covers all avenues of implementation instead of the typical narrow "quickest route".. so nice to finally see a unity dev who understands SOLID and access modifiers and why public methods should be minimized. Coming from other platforms I'm kinda surprised the lack of comprehensive docs for alot of Unity stuff, anyway your tutorials are great!

ultimatesin
Автор

I often get a lot out of train-of-thought type of follow-along stuff in unity, but I'm six minutes in and subscribed, and a little bit excited. It's not just the organization; your voice carries my attention, which I really need for topics like this

facejets
Автор

thank you for this. ive watched other input system explanations but they often dont go over the full options of implementation (im taught how to use component but not how to get constant values from it directly) and so i was left using a weird combination of the generated class and the component since i was only shown a how to do certain things using certain ways.

Also i appreciate explaining that one can make input action variable to avoid typing strings constantly and risking mistyping. Now I know to look for ways to avoid that not just with this, but with all my code.

great tutorial overall and very well organized and explained.

justincarlson
Автор

Took so long for me to find a video that made sense, thank you!

mellaytheghost
Автор

This video is so good! You explain the system so well and go over everything important, but you don't overexplain. I keep coming back to the video every time I need to set an input system for a game to remind myself how to do it and it always clears up everything.

gilireeves
Автор

I have given a chance to the new input system multiple times but I always rejected it because other tutorials made it look very complicated, I'm finally using it thanks to you!

EfrainJMDev
Автор

The bit near the end about InputAction & InputActionReference is the interesting part :D.. I can see this integrating into many scenarios well. Thanks for the video <3

dmtuan
Автор

The most comprehensive tutorial on the "New" Input system. Thanks.

chunkyquail
Автор

This was incredible thank you so much with your help I was able to overcome a problem that I had been stuck on for 3 days, and I really struggled elsewhere and with the documentation as well, thank you so much!!!

alexocaber
Автор

This is extremely helpful lol. I had seizure from TL;DR syndrome when I tried to go through the manual by myself. Thanks

dongminkim
Автор

I've been confused in adapting new Input system since I'm a beginner in Unity, but this video helped me so much. Thanks a lot!

despia
Автор

this is the best tutorial to know everything with new input system, thank you so much for creating such wonderful tutorial

basavarajguled
Автор

This is very useful even for VR, the XR Interactive Toolkit takes a very similar approach as the Input System(I just looked up: the XR Interactive Toolkit depend on the Input System), all the knowledge fits nicely in VR, the action based controller, input action, binding, several different ways to get the user input in code. Appreciate your sharing. Thanks.

Drquan
Автор

Great video!

The one thing that makes Control Scheme such a great part of the Input System is its implemented listening & switch option.
Let's say that you want to allow the player to use either a Mouse and/or just a Keyboard or a Controller. Obviously, the kind of inputs will varies where one scheme might requires a press of a button to initiate the use of another input and so on so, originally, you mostly had to add some sort of full-time listener to any action of any device "not in use" so that you can apply some kind of switch as to what the player uses in case he or she decide to change which control to use mid-game.

For example, let's say that you have a zoom function in a isometric-viewer Action RPG that allows the player to zoom in and out. On Mouse & Keyboard, simply scrolling the mouse wheel does the trick and, in case someone prefer to player using only a keyboard, it's fairly simple to add additional binding to some Numpad keys. But what about the controller? What if, to zoom in and out, the player has to toggle the zoom-in-out prior and after zooming with something like the right stick as, otherwise, the left stick is used to aiming?

This is where the Input System does a really good job because its gives many ways of "knowing" and handling what is going on instead of just attempting at reading every small possibilities out of the players' reach.

creationsmaxo
Автор

you should be getting paid for teaching so thoroughly i cant imagine the amount of preparation it requires to simplify so clearly all the information for the learners
(and i thought brackeys was the best tutorial creator out there even though his tutorials are kinda outdated now but guess who im switching to nowww)
p.s. the amount of side videos linked to this one is incredible

atomiz
Автор

Best video about the input system I found do far! Well done!

tarekmustafa
Автор

I confess I'm impressed. this video is great and explain everything really well.

filipezanella