How get the altitude of a gameobject above a terrain

Hello! I’m new to unity and I want to know how a gameobject’s(aircraft) altitude is acquired based from its height above a given terrain. Thanks

Use SampleHeight to get the altitude of the terrain, and subtract that from the y coordinate of the object’s transform position: Unity - Scripting API: Terrain.SampleHeight