So, I am trying to make a few units orb around a hero but the height must be relative to the hero, so they always remain at around his head level.
Unfortunately, while doing it I ran into some very weird results, as seen in the attachment.
There, I try to put them at the exact same Z as the hero, so the problem is much more visible.
The numbers on the side are the flying heights of the units (go up to 30 while moving, and never go below 0.0010).
I am pretty sure this became a problem after 1.27, though I may be wrong and just not noticed it before (although it is very obvious).
What I know for sure, is that the hero's head is around fly height 75, and the 24 fly height units around it go much higher.
Not only that, but the orb that is seen above him is actually on lower ground.
What could I be missing? I havent had this happen before, I think it might be a bug in the new patch.
Unfortunately, while doing it I ran into some very weird results, as seen in the attachment.
There, I try to put them at the exact same Z as the hero, so the problem is much more visible.
The numbers on the side are the flying heights of the units (go up to 30 while moving, and never go below 0.0010).
JASS:
call SetUnitFacing(udg_Orbs[i], udg_OrbAA[i] + bj_PI/4) // in case these make any difference at all
call SetUnitPosition(udg_Orbs[i], x, y) // so the unit turns properly without going glitching
//x and y are the unit's new coordinates
//mx and my are the hero's coordinates
//udg_Orbs[i] is the unit in question
call SetUnitX(udg_Orbs[i], x)
call SetUnitY(udg_Orbs[i], y)
set loc = Location(mx, my)
set mz = GetLocationZ(loc) // Hero has fly height of 0, so not adding it
call MoveLocation(loc, x, y)
call SetUnitFlyHeight(udg_Orbs[i], mz - GetLocationZ(loc)/* + height to head level, when I fix it */, 0)
call BJDebugMsg(R2S(GetUnitFlyHeight(udg_Orbs[i])))
I am pretty sure this became a problem after 1.27, though I may be wrong and just not noticed it before (although it is very obvious).
What I know for sure, is that the hero's head is around fly height 75, and the 24 fly height units around it go much higher.
Not only that, but the orb that is seen above him is actually on lower ground.
What could I be missing? I havent had this happen before, I think it might be a bug in the new patch.