Unity's 'NEW' Input System with C# Events

preview_player
Показать описание
Unity's new input system is event-based plus it handles keyboard mouse and gamepads easily and quickly. The video looks at action maps, actions, bindings, action types, interactions, and processors. Which can be used to dial in the controls for a Unity project. The system can broadcast messages, use Unity events, or best of all use C# events which can clean up your code - specifically your update functions.

Version 1.0.2 of the input system was used along with Unity 2020.3


Assets Used (affiliate links)
******************************

Want to support the Channel?
*******************************

Other Links
************

Video Gear List (Amazon Affiliate)
***********************************

Timestamps
*************
0:00 Warning!!!
0:09 Intro
0:40 Why use the new system?
2:04 Adding the New Input System
2:50 Creating the Input Asset
3:23 Action Maps
4:06 Actions
4:27 Action Types
6:35 Interactions
7:10 Processors
7:30 Creating Bindings
10:19 Saving Input Asset
10:39 Default Player Input Component
11:14 Generate C# Class & Events
11:50 Player Controller Class
15:10 Testing the Controller
16:08 Want to see more???
16:30 THE END

#unityinputsystem #GameDevelopment #Unity3D #indiedeveloper
Рекомендации по теме
Комментарии
Автор

If you're following this tutorial and can't find yourself a 2d composite
please note that unity input 1.3.0 or above, has wrap up the composite creation
on Movement(green tab) select action type from "button" to> "Value" and underneath controltype to "Vector2"
now when you right click on green tab
it will show up/down/left /right composite which is the same in this video
and you will be needed unity input 1.1.0 or above for key rebinding later on

HorizoneMeNol
Автор

The problem with the unity new input system is that they dont know how to make a tutorial like this. Thank you very much sir, bravo!

amieldanao
Автор

I have watched 2 other guides on the new input system (I only just upgraded to it) and this is the best tutorial I have come across. Thank you.

steveradtke
Автор

you can use the entire "left stick" if you set the action to "passthrough" and "Vector2". Works really well for capturing those angled movements!

pi-or-die
Автор

Adding a gamepad on the old system is super simple. Took 5 minutes and no additional code after watching a tutorial on YouTube. But this is still a good tutorial.

AnySL
Автор

2 years later, and this tutorial is still a life saver.

Thanks!

_jonathancollins
Автор

Just watched your Delegates, Events, Actions and Funcs video and this back to back and you sir, have a new subscriber. I'm trying to switch over from using the OVR input system for my first VR game and almost had a heart attack when I realised what I'd have to do to use this, but I can see how this method would clean up code across the whole project. Thank you!

corygreaves
Автор

Just a part way in and I can see a few things, this video is updated with new information unlike others that are heavily outdated with experimental information, the information is concise and honest / straight to the point that this new system is more complex, and its heavily detailed with suggestions of where else to look for further information with the video broken into sections. Subbed! Keep up the videos, these are really really well made.

CosbyKong
Автор

Thank you for putting out a wonderful tutorial that explains very precisely, without confusion the new and rather complicated Input System! Not only that, you also explain why the new Input System is superior in some cases!

Thank you very much for freeing us from the pain of confusion of the new input system!

exhilex
Автор

Best explanation I've encountered so far. Although it wasn't what I was looking for, it does shed some light on the input system itself. Now I just have to figure out how to do this with complex UI scenes like main menu n all that.

lilyflowerangel
Автор

Thanks for the walkthrough. I was using the C# events as regular events and was getting severe performance issues. I didn't know I had to use farmerInputActions.Disable() on OnDisable() for the new InputSystem. You don't have to do that for each event [e.g. farmerInputActions.Player.Jump.Disable()], just for the input mapping file itself Great video!

cathalmccosker
Автор

I have tried so many different videos the last few days to get the new input player. So thanks and I will be subscribing.

jamesstephenson
Автор

Thank you for this video! I had been wracking my brain trying to understand how to make this work and other videos I found were using the older version which was more confusing than anything! Thank you again!

Miale_of_the_Void
Автор

SUCH a good tutorial! Really clean and easy to understand, thank you! I'm super glad they built this new system as it keeps the code much cleaner and allows for a lot of flexibility in your game's input.

VirtualTurtleGames
Автор

super clear explanations and i feel like i'm starting out with the complete toolbox with this system. Thanks a lot man

neorevolutionnar
Автор

I just wanted to leave my "Thank you for this great explanation!" here. Will watch your other videos as well, I really like how you explain things.

heavymetalhamster
Автор

Upon watching your Key Rebinding I realised from this video I didn't generate my C# script, I was going crazy! I have to say though your videos are super helpful and I am 100% going to be watching more. Thank you :)

dannybrez
Автор

I have been learning this system for 2 days. I've seen some people using the Player Input component. Which made it even more complex & vague.
Your explanation and way of doing it, is the best I've encountered.

Thank you for your time & effort. :)

littlearvin
Автор

I'm very grateful for this video! at the start of the month I decided to get back into making my own game again, but I put a lot of time into learning the old system and gotten use to it really well. But coming back after a year, and seeing how many people are pushing for the new system, I wanted to try and learn it and use it. How ever, it was kind of over whelming, and a lot of tutorials I tried to look up didn't really explain what a lot of the systems did (example : the action types), and I just got frustrated and stopped trying to make my game. Today I said "To heck with it" and i was going to use the old system. Before I did I decided to look up tutorials for the new system one last time just in case . Your video came up and I gotta say THANK YOU! Your tutorial was much more straight forward, and easy to understand, even more so when you explained each part did . Again, thank you so much!

Edit :

I would really like to see a tutorial on "Tank Controls" with the new input system ! I understand WASD movement, but I always liked the resident evil style control type, and I always wondered how I could use that as well. Or to be more precise, using A and W to rotate the character, and using W and S to move forward and backwards. I could never find a good tutorial on how to make my own, both in 2d and 3d games. Could you cover that controller type in the future some time please? I would love that!

ZeroChronicles
Автор

Great video, loved it. Just complex enough to get the full picture but not overly complicated and confusing for someone of intermediate skill level.

goldkat