HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

GetUnitZ??

10-05-2009, 04:59 AM#1
blanc_dummy
How to get Unit Height (Z), without use location?
10-05-2009, 05:00 AM#2
Rising_Dusk
GetUnitFlyHeight returns a unit's flying height, which is the unit's "Z" coordinate. If you meant the Z coordinate of the point the unit is located at, then you need a location since Blizzard hasn't made GetPointZ yet. (They really should!)
10-05-2009, 11:35 AM#3
grim001
You can't get a unit's Z coordinate without using locations. You have to get the height of the x/y location of the unit using GetLocationZ, then add the unit's flying height to that.
10-05-2009, 03:16 PM#4
Earth-Fury
To clarify:

Units have a flying height. (Which, for ground units, is 0.) That is a unit's height above the terrain.

GetLocationZ returns the actual Z height/position of the terrain at a given X/Y point.

Thus: GetLocationZ + GetUnitFlyHeight = A unit's absolute Z position which is not relative to the terrain.

----------------------

Use a single global location object coupled with MoveLocation(). Move the location to the unit's position, then on the next line use GetLocationZ on the location. It just adds an extra line before any line you need to be getting a unit's Z height or the terrain height. Not that bad.

Do NOT create new locations each time... That would be a pain in the ass.