How do I make my ship align itself with the ground, stop, and land. And how do I set up specific landing areas
(If you have played battlefront 2005 you know how this will work
)
Okay create an Actor called βZoneβ.
Lets dive into vector algebra.
- Align the roll of the ground to the roll of the plane (ship).
- This will also make sure the upvector is perpendicular to the ground (As far as you are flying parallel to the ground)
- There are many ways to detect a zone, you can do a downward raycast from the ship (which you would probably do in most cases to check altitude). If the ray cast hits the zone collider, you know you are on top of a zone.
- Once you are on top of a zone, turn it into auto pilot mode (thats what you want it right?), interpolate the roll of the plane to the roll of the ground.
- This will make your upvector perpendicular to the surface, now you gently hover downwards and land on the surface. This should provide the functionality of the ship landing on the surface.