How to rotate and move the camera when a specific key is pressed?

What I’m after is when I press A or D the camera will rotate 90 degrees left and right but when looking at a specific place and W is pressed the player will move forward to a specific position and stop, I don’t want the camera to be stiff either, when moving forward the camera needs to be animated so it moves around and rotates. Here are a few examples I made in Blender:

Each time A is pressed: Screen capture - fd065047ac6cf73a76eccbe43b38a5a6 - Gyazo

Each time D is pressed: Screen capture - 1c104e665bfc8d7924cc60634402ed24 - Gyazo

Each time the player is looking in this direction and W is pressed: Screen capture - fd0cc6d7d13b985efd3394b4d3979cf6 - Gyazo (after this the player should be able to turn around again using the same A D mechanics and move back to the beginning by pressing W)

What the camera is animated like when moving: Screen capture - 47d4b7a23b37ae860713cdf217ba650e - Gyazo

Hi SalamanceYT,

Here is the solution I came up with to implement Dungeon Crawler movements, hope it fits your needs :

I Migrated the FirstPersonCharacter from the demo project FirstPerson as a start point but if you already have a Character in your project you can use it. Also I deleted everything that was already set up in the Event Graph. Now, let’s begin :

  • Create 3 Action Mappings : MoveForward, Rotate90L, Rotate90R in the Editor settings.

  • Movement logics (inside your Character class) :

Create a Timeline to have control over the movement fluidity and duration (Right click then type ‘Add Timeline’ and double click on it to edit). To smoothen the curve, you can right click on the key and select ‘Auto’ as the interpolation method.

  • Rotation logics (inside your Character class) :

Create a Timeline to have control over the rotation fluidity and duration (Right click then type ‘Add Timeline’ and double click on it to edit).

Feel free to ask questions if something is unclear.

Cheers.

This was very helpful as I’m trying to make a dungeon crawler on a grid myself! Few more things I’d like to able to do tho:

How do I increase the size of a single step? I tried messing with the timeline duration and final value but so far, my character always takes 100 unit steps.

I also want to set it up such that my character will keep stepping while the button is held down. Anyone know how to arrange that?