I'm currently trying to determine the player's altitude. I think I've found the correct way of doing it but would like to ask if anyone can confirm it is:
- edit
Updated the code example to display altitude percentage
Code: Select all
GameObject player = GameManager.Instance.PlayerObject;
float altitude = player.transform.position.y;
altitude += Mathf.Abs(GameManager.Instance.StreamingWorld.WorldCompensation.y);
float altitudePercentage = (altitude / DaggerfallUnity.Instance.TerrainSampler.MaxTerrainHeight) * 100;
DaggerfallUI.AddHUDText("Player altitude: " + altitudePercentage.ToString() + "%");