er2.getDistanceFromTerrain 2

Returns the distance between the given position and the terrain.


Return value

Return TypeDescription
floatImportant: if the given position is under the terrain, will return a negative distance

Parameters

ParameterTypeDescription
1vec3The starting position
2bool(Optional) Used for positions over water. If true, if water is present, returns the distance between the starting point and the surface of the water, or else the bottom of the sea. Default is false

Examples

No examples available.


Back to Scripting API