How do I set up rigid body rotation towards a target vector?

Hi,

I am planning to make a space ship that controlled by mouse similar to a strategy game where you click somewhere and actor is trying to get there. To get a more or less realistic look I want to use rigid body physics to make ship rotate nicely towards target direction.
Before I do all work by myself I was searching source for something similar that is already part of engine and can be used for my purpose. source however is huge and I might have overlooked something. Therefore I want to ask here if there is a feature somewhere that could be useful in this case. Maybe something related to AI pathfinding.

I would be grateful for any helpful comments.

Hey ,

Take a look at Top Down templates, whether in Blueprints or Code. project uses a Nav Mesh and click-to-move controls, with a smooth turn transition for character, which sounds like exactly what you’re looking for.

Hope that helps!

Thank you for helpful comment.

I had however a few problems when I was playing arround with that feature:
It looks like movement direction is not connected to orientation of character. I tried to lower rotation speed of character to get something that might be mistaken for a space ship changing its course and ended up with a character who moved to target point in a straight line while still ‘looking’ in original direction.
Another problem was missing momentum. As soon as I ‘told’ character to turn in opposite direction character starts turning in that direction, ignoring its angular momentum in previous direction.
Another closely related point is that character seems to turn at a constant rate. To get a somewhat realistic effect I would need an accelerated movement.

Is there a way to switch on those features or do I have to play arround with ‘AddTorque’ function.

Yea, it sounds like you’re going to need to go a lot deeper into your Blueprint to get what you’re looking for. Top Down template is a good reference point, but Simple Move to Location node in Move to Hit Location graph isn’t an editable function and is based on Nav Mesh system.

Take a look on AnswerHub and forums for what other users have built so far. Here’s a couple links that might help get you started:

It is certainly possible to build what you’re looking for, though, if you’re willing to experiment some. I hope some of this helps!