How to Swap Action Maps In New Input System

We can go about changing our action maps through script. To start, we will create a few actions.

Lets create a couple action maps and actions to start

build in a new action map and the logic for Unity to switch between the 2:

What I have done is created a simple button action in both the player and the drive state. These actions are in place to just change our player from the different states. Now, once we have set up our driving state the move around , we can test to see if we have the different actions in the states

I used a bool to trigger the state on and off when the T key is pressed

We have built in the logic to allow the player to have different states depending on the situation they are in which allows us to have multiple actions for the same keys.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store