4-directional player movement in UE5

How would I get the player to only be able to move 4 directions (up, down, left, right) in UE 5.4 with the enhanced input system? I have been looking around for an answer, but they all use the old input, so I’m going here as a sort of last resort. My project is a top-down pixel art RPG inspired by those on the Nintendo DS, and I want it to have that same feel.

You can find an example of the enhanced system with most of the template projects in UE5. For this, I’ll use the ThirdPerson template since TopDown doesn’t come with WASD.

You’ll find all of the mapping contexts and input actions under Content → ThirdPerson → Input. The InputActions (prefixed IA_) are the various possible actions- they don’t determine the keys, just how the action should behave (ie type of input, modifiers, triggers, etc). How you actually bind to keys is inside the context (prefixed IMC_), which can optionally override the settings in the InputActions.

All of the input is handled in the player character under Content → ThirdPerson → Blueprints → BP_ThirdPersonCharacter. The active context is registered on BeginPlay. There can also be multiple, or no active contexts.


There are a bunch of videos out there on how to use the enhanced input system, if you prefer video format.

Then perhaps start the project in UE4, then open it with 5.