How to make realistic spaceship flight "Roll, then Pitch"

Hello Devs,
I am trying to make a spaceship that flies its way to a target position using LinearVelocity and AlignOrientation.

Currently, the ship can fly toward any given point. However, I want the ships to roll facing the target, and then pitch toward it, effectively turning itself toward the target.
image
My intention can be seen in a fighter jet’s flight. It turns its top toward the target, then changes its pitch to align itself with the target.

That is the goal I’m trying to achieve. I want my spaceship to:

  1. turn its top face (or bottom face, whichever is closest) toward the target
  2. rotate up or down on the pitch axis until it is in line with the target.

My current code uses CFrame:Lookat(ship's position, target's position) in order for the ship’s alignorientation to turn toward the target. However, this obviously means that it would be facing up to look at the object, and mostly move on the x and z planes.

If someone could give any ideas on how I can do this, it would be greatly appreciated.

1 Like