getPosASL _obj select 2; might sometimes return the vertical position above sea level, but over land for stacked objects, it returns the vertical position above the object beneath it or at least affected by this offset.
The same problem exists for getPos. There was a thread in the BIS forums which suggested the use of the command modelToWorld instead to get around this issue where an absolute vertical position is required. ArmA Ver 1.02.
Description
Returns the object position height above sea level.
Syntax
getPosASL object
Parameters:
object: Object
Returns: PositionASL
Examples
Example 1
_aslPos = getPosASL player;
Example 2
hint format ["position above sea level: %1", (getPosASL player) select 2];
See also
getPosASLVisual · setPosASL · setPosASL2 · position · getPos · getPosATL · getPosASLW · visiblePosition · visiblePositionASL · getTerrainHeightASL · setUnitFreefallHeight
Community notes
According to Code Optimisation, this command is among the fastest (2x) and should be used (or getPosATL or, best performance-wise, getPosWorld) instead of getPos/position.