How to make character moves in the direction of the camera forward, not world forward.

Hi everyone! First time here. I’m a newbie in UE 5 and I’m trying to do a camera setup for a top-down game, But I can’t figure out how to?

Currently my character is able to move with WASD in fixed camera angle(and face the direction where characters moving.)
But I also want to set up a hold “mouse right button” to rotate camera. And when rotating the camera, character moves in the direction of the camera forward, not world forward. How do I achieve that?

Need help thank you!

1 Like

I would suggest you modify controller rotation with your controls and then use that to control both the actor movement and the camera rotation.

Thanks for your reply, what do you mean by that?

My current character WASD movement blueprint setup(controller blueprint):


and Hold RMB camera rotation blueprint setup(controller blueprint):

So now the problem is:
When I rotate the camera, the character is still moving in world direction, and not the direction my camera is facing. I want my character to move in the same direction of the rotated camera while holding movement input + camera rotation input.

Use character?

Your can create ‘First Person’ or ‘Third Person’ project and see example.

Hey @MsJellyFishy

No need to complicate things!

To achieve this objective:

All you need to do are these:

Implement these blueprint codes in your Event Graph:

(You can chord the IA to right mouse button like you wanned to from the IMC)

And you’ll also wanna enable Orient Rotation to Movement and disable Use Controller Rotation Yaw for the character.

If you haven’t done those already:

Select the character movement component from the Components window on the top left, navigate to the Details window on the right side while having it selected, and enable the Orient Rotation to Movement property.

Select Self from the Components window, then while having it selected, navigate to the Details window, and under the Pawn section, disable the Use Controller Rotation Yaw property like this:

And don’t forget to enable the Use Controller Rotation Yaw property for the Spring Arm! You do it the same way, but this time select the Spring Arm component from the Components window.

Hope these help! :innocent:

1 Like

thanks for your help!!

1 Like