Quick Question

PrisonLove

Hard Realist
Reaction score
78
When you use SetUnitZ(), does it set the unit's Z coordinate in relation to the current terrain height, or does it set it in relation to 0?

Edit: Okay apparently SetUnitZ() does not exist. Can anyone tell me what function I'm thinking of, and answer whether it's set in relation to the current terrain height or 0?
 

Tru_Power22

You can change this now in User CP.
Reaction score
144
Only works if the unit has (or was given) crow form. So be careful with that.
 

cleeezzz

The Undead Ranger.
Reaction score
268
SetUnitFlyHeight = relation to 0

(same as below, but the below would work with ground units)

JASS:
function SetUnitZ takes unit u, real height returns nothing
    call UnitAddAbility(u, 'Arav')
    call UnitRemoveAbility(u, 'Arav')
    call SetUnitFlyHeight(u,height)
endfunction


below would be in relation to the terrain:

JASS:
function SetUnitZ takes unit u, real height returns nothing
    local location tp = GetUnitLoc(u)
    local real z = GetLocationZ(tp)
    call RemoveLocation(tp)
    set tp = null
    call UnitAddAbility(u, 'Arav')
    call UnitRemoveAbility(u, 'Arav')
    call SetUnitFlyHeight(u,height-z)
endfunction


Assuming 'Arav' is crow form.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top