Switching Action Maps in Unity's Input System

preview_player
Показать описание
Switch the current input action map and enable/disable multiple action maps easily with Unity's Input System.

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

📥 Get the Source Code 📥

🤝 Support Me 🤝

►🔗 Relevant Video Links 🔗
ᐅInput Action Map Documentation
ᐅMultiple Action Maps Forum

In this video I will show you how to switch your input system action maps. We will use the PlayerInput component to switch the current action map, then I'll show you how to enable and disable multiple action maps at the same time, using both the PlayerInput component and the Generate C# script way. It is important to note that your action names should be unique throughout your input action asset.

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!

😎 Other Cool Unity Assets 😎

►⏱️ Timestamps ⏱️

💖💖THANK YOU TO ALL MY PATRONS 💖💖

❯❯❯ My Links ❮❮❮
💗 Patreon 💗
💬 Discord Server 💬
🐦 Twitter 🐦
📚 Facebook 📚
🎵 Music 🎵
Ambient Gold
👍 Like and Subscribe! 👍

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

#madewithunity #gamedev #unity
Рекомендации по теме
Комментарии
Автор

I love that you were the first result when I googled this problem. Its nice to know someone is on top of making these tutorials.

sprite
Автор

Seems like every time I go searching for how to solve my next game development problem, I land on your videos! Thank you for your work. It has been an enormous help!

DanDectis
Автор

Another awesome video! I love how easy to understand are these tutorials!

kazmaBlends
Автор

Straight to the point and super accurate. (Still works great as of 2022.3.12f1). Thanks, Sam!

travhimself_
Автор

You are always here when I need you the most!!!

xthanatos
Автор

Definitely among the best Unity tutors on Youtube.

LoxagosSnake
Автор

Your content is so useful, so clear, and so helpful. Well done, and thank you :D

benjaminlehmann
Автор

oh my god i needed this, thank you so much. You're videos are awesome, thank you for explaining the "new" input system.

eldelnacho
Автор

Awesome video. Quick, very informative, and to the point without needless complexity. Keep up the good work. Saved me a ton of time.

gfujigo
Автор

Very helpful thanks for the tutorial! Likely saved me a bunch of time.

SuperDutchrutter
Автор

Thank you so much, you just saved my day 🙏

Dustb
Автор

Just discovered your videos and I'm amazed at the amount of quality. Really good job. I've been having trouble with Unity's new input system recently. Do you by chance know how execute different code depending on the input device? For example, aiming with the mouse (top down perspective) uses different calculations than aiming with a controller's left stick. Again, great job on the videos!

alejandrogomez
Автор

That's GodSent Good Info for us little game developers ~~

NostalgiaNote
Автор

Your videos on the new input system are really great. Keep the good work !. Just curious to know, how do we use two action maps without having a key binding to switch between them? Use case scenario is having a world space UI on the scene above a gameobject, where I have both object interactions and UI interactions. Hope you understand my question.

vikneshtk
Автор

I still wonder which approach is better, use script or playerinput component. If it's just personal preference then I would use playerinput, it seems much more cleaner. Also I have one big blowmind about using newinput system in for example rts game. Inputs them selves are not that clean like in this example, there is no like character or something like that, there are functionalities like selecting or do action for some specific units buildings etc. Giving that example the question I want to ask is, What is the convention of creating action map? btw sooo good work! Very solid and to the point tutorial!! :)

deo
Автор

Can you make a video on getting values from sensors using unity's new input system or provide some stuff that can help to get through it, because there is not any video or proper documentation more code available on the internet to get value from sensors using new input system.

MayurChauhan
Автор

Can you explain when you create your OWN UI action map in your custom just as you did why the UI elements then break? Just switching the Actions Assets to your Own doesn't seem to do the trick from my own understanding. The only way I can get the UI elements to work is to use the Default Input Actions for UI elements??

seanlaughlin
Автор

Hey Sam, just noticed when you mentioned patrons, there was a name АРТЕМ, i think it is russian name and pronounced "Artyom", just like protagonist from Metro games.

brutalsam
Автор

Samyam would you be able to make a video on Local multiplayer Third person cameras ? Maybe a camera that can rotate around the player with the right gamepad stick And movement on the left gamepad controller ?

cameronpheiffer
Автор

When I use the method SwitchCurrentActionMap on playerInput i get an error of that the function doesn't exist

Toksick