_logic = "logic" camrcreate [0,0,0]
_logic setpos getpos _unit
_height = _logic distance _unit
As you know, when you are on top of a building, (getpos select 2) returns 0. So by setposing' _logic to _unit's position, _logic will end up on the ground, but at the same X/Y point on the map. Thus, the distance command will only return the difference in height between the two objects.