New Input System — Swap between Action Maps!
Objective: Create logic to change Action maps!
We have discussed before that we have different Action Maps, the player, driving, flying, etc. In this tutorial we are going to switch between maps. If you player walks up to a car and presses ‘T’ then we will want to drive the car.
To begin we need to create a button Action under the Player.
Now we open our script and all we have to do is register a preform for ‘Drive’ Action.
Now when the ‘Drive’ Action is called we can switch our Action Maps. When called we can disable the Player Action Map then Enable the Driving Action Map.
Now when we press the ‘T’ key the Driving Action map will be the active Action Map. We can use our former movement method from a past tutorial.
The movement inputs will only be active when the Driving Action Map is enabled.
Now you know how to switch between Action Maps. Don’t be afraid to experiment with your code, and I’ll see you in the next Tutorial!