How to rotate a movement component to face the same way as the mesh?

I am trying to get a topdown spaceship to fly around. I got it to move forward like I want to, but when I turn, I want only the mesh of the ship to turn. The movement has to continue along it’s current vector. Only when I press forward again, I want the trajectory to gradually change to the direction the ship is now facing.

Now when I turn my ship with ‘AddActorLocalRotation’ the ship turns, but so does my forward trajectory. When I do an ‘AddWorldRotation’ on my ship’s mesh, the mesh turns, but then the movement component doesn’t know I have changed directions.

How can I set the movement component to face the direction the mesh is facing? Or is there a better way to recreate that gravityless movement? I am using a defaultpawn-parent, not a character parent.

Hi there! Movement component is not a Scene Component, so it has no any Rotation and no Location. To control movement with it you can use Add Input Vector node in your Pawn. In fact just add input that you need in input events with this node and that should work fine in combination with other logic. Try not to use Tick for input events.

Made the movement work as I like it by making use of ‘set physics linear Velocity’ (instead of addactorlocationoffset). I’m basically going for ‘Asteroids’-like movement.

I’m still using the Event Tick for rotation though, but I’ll take a look at that later (I just used the ‘FlyingPawn’ BP Unreal gives you when starting that kind of project as a base, apparently they use tick for input events …).