Rotate Actor with Mouse Position on Screen

2022-05-21 13-38-48.mkv (4.8 MB)

Hi there –

I’m trying to have the ship rotate dependent on where the mouse cursor is on screen… I’m trying to use DeprojectMousePositionToWorld and RInterpTo to make it a smooth movement. I suspect it has something to do with how I’m calculating TargetRotation…

Any help appreciated! Thank you, I’ve been going a bit crazy attempting to solve this…

1 Like

It’s not entirely clear what you’re trying to do, but perhaps another approach to consider might be projecting the ship location to the screen and then using the 2D vector delta between the ship screen location and the mouse location as the axis input to your control system.

Another thing to think about is using the physics system and applying torque (angular acceleration) rather than setting the actor rotation manually.

2 Likes