Player facing wrong direction when using Add Movement Input

Hi,

I’ve been playing around with movement for a top-down space shooter type of game where the ship rotates to face the location of the mouse cursor and will move forward towards that point when W is pressed.

Every tick I update the rotation, like so:

And here’s the MoveForward event:

When I test this the player rotates correctly when moving the mouse, however, when I try to move forwards the ship goes crazy and moves back and forth. When I’m trying to move forward the ship is trying to face the opposite direction, but the rotation stuff is kicking in and trying to get it to face the correct way and they fight it out.

I can’t figure out why it’s doing this. I’ve tried checking out the rotation settings on the character movement component which doesn’t seem to change anything whether they are on or not makes no difference. The character is definitely facing the right way in my blueprint, following the arrow so it doesn’t appear to be anything obvious like that. I must be missing something somewhere, or I haven’t set up the movement correctly but I haven’t been able to figure it out.

Could you try using “Get Hit Result under Cursor” instead of “Convert Mouse Location to World Space”?

I seem to remember something like that happening to me as well and the issue was that it didn’t convert the location to the ground but like slightly in front of the camera or something like that. “Get Hit Result under Cursor” fixed it for me.

Yeah that seems to have fixed the problem, rotation is fine now. :slight_smile: Thanks.