character face and move in direction of key press

Hi,
How do I move my character mesh in the constant direction of the key press, ie if the character is looking forward and I press D, the character should rotate to face the right and continue moving right

currently I rotate it but when moving the character will walk in a circle instead of the direction

Because you orient rotation to movement, the right vector of the capsule will continuously change as it rotates. One option is to use the right vector of the camera instead.

Additionally, you could use this instead:
Capture

annoyingly moving left to right works great, but when I move the camera he will rotate with it but I only want to move purely to the right and have the camera rotate freely. Even with orient rotation to movement off he will still move relative to the camera.

image

Edit: Based on your most recent post I understand what you are trying to do now. Go back to your original setup from your initial post’s screenshot. Then just disable orient rotation to movement. The character should move freely apart from the camera. Let me know if you have any issues.

1 Like

that kinda works better, my only problem now is that I need the character to face the direction they are moving whether it is forward, sideways or backwards.

Please excuse my lack of sleep lol. This is exactly what you want:

Just enable orient rotation to movement (and disable use controller yaw pitch roll). Make sure the camera (or spring arm if it is the parent) has Use Pawn Control Rotation set to True.

1 Like