- Joined
- Oct 11, 2012
- Messages
- 711
If a non-flying unit is on a slope, how to accurately get his Z coordinate?
I want to create a lightning falling downing from the sky on an enemy unit. If I use the flying height of the enemy unit, whose position is on a slope, as the Z coordinate, the lightning impact point on the enemy unit appears to be on the ground in front of such unit. The reason for this is because the unit height is zero, but the slope "makes"the unit's model to raise to a certain height, which cannot be detected by "GetUnitFlyHeight" and causes the seemly misalignment.
So what should I do? Is there a way to solve this problem? I do not want to create a dummy on the sky to cast Finger of Death to the enemy unit.
Thanks all.
I want to create a lightning falling downing from the sky on an enemy unit. If I use the flying height of the enemy unit, whose position is on a slope, as the Z coordinate, the lightning impact point on the enemy unit appears to be on the ground in front of such unit. The reason for this is because the unit height is zero, but the slope "makes"the unit's model to raise to a certain height, which cannot be detected by "GetUnitFlyHeight" and causes the seemly misalignment.
So what should I do? Is there a way to solve this problem? I do not want to create a dummy on the sky to cast Finger of Death to the enemy unit.
Thanks all.
Last edited: