Add movement input but for smooth rotation, not just forward/backward

Hi everyone,

I’m trying to create a small spaceship behaving with some inertia. Using “Add Movement Input” and the “floatingPawnMovement” component, I get the desired effect but only for forward and backward. However, I can’t seem to be able to use that same function to do smooth rotations.

Note that the camera just follows the ship location, but not rotation. The camera is set at a 3/4 45° top-down style.

I’ve looked everywhere and so far I cannot find a single example of smooth rotations using the same built-in behavior has the Add Movement Input + floatinGPawnMovement combo… It’s always some workaround with lerp and such.

What I’m looking for is EXACTLY what they have in this video, at 3:44, with both inertia for all movements and a static camera that just follows the ship around.

https://youtu.be/-CYdZTMvExU?list=PLCEllhcsdc7Yt7MxD1YIO2lM7ZaRJirCg&t=212

Thanks a lot !

Hello @Gnougnou ,welcome back to forums!
If I understood you correctly, this might help:

You could create an IA_MoveRight/Left input action of type Axis1D, configured so that A has a negative value (using the Negate modifier) and D has a positive value.


Then, use a Spring Arm properly set up for the camera. The Spring Arm does not add real inertia to the pawn’s rotation, but it does help make the camera movement feel smoother, especially when the rotation comes from player input.

If that’s not the case, could you explain in a bit more detail what you currently have implemented?

  • How are you handling the ship’s movement?
  • How are you applying rotation?

It would also help a lot if you could show a more detailed example of how you’d like the final rotation to look.

I understood the general idea of what you mentioned, but I’d like to confirm to make sure the solution goes exactly in the direction you need.

I’ll also leave a post here where they discuss how to rotate the camera using different keys.

Hope it helps

Hello, thanks a lot for your time and reply. I edited the main post to include an example (made in UE actually) that shows exactly what I need.

Alas the spring arm behavior won’t help as the camera needs to stay fixed in rotation, only follow the ship around.

So far, all I have is this :

It magically works for Forward and Backward because of the FloatingPawnMovement that allows me to set an acceleration, max speed, and stopping speed, but it doesn’t absolutely nothing for rotations.

Note that with this code, after rotating the ship, going forward or backward will keep going along the X axis, and ignore the ship forward vector, as currently I only multiply 1 or -1 with the World Direction. I’m gonna fix that, but this is beside the point of this thread :wink:

One of my issue is that because Forward and Backward currently magically happen while rotation doesn’t not, unless there is something I’m missing, it feels like I’m heading toward a half-homemade solution with rotation being made by me while acceleration/stop will be handled by magic in FloatingPawnMovement, which is something I absolutely want to avoid. Either FloatingPawnMovement has a built in smooth rotation feature included that I’m not seeing, either I’ll just do everything by myself so I have full control over my ship.

I ended up finding a tutorial on how to make a helicopter, which was very similar to what I was trying to achieve (smooth building up forces)

So I solved my problem with this surprisingly simple code :

I ditched the FloatingPawnMovement, and replaced it with a PhysicsThruster, then activated physics on my ship, locked Z location so the ship stays on the same plane, locked X and Y rotation, and that’s about it. Linear and Angular Damping are exactly what I needed to simulate opposing thrusters and get smooth acceleration and braking.

All good !

1 Like