- Joined
- Feb 4, 2008
- Messages
- 3,511
I have a problem, whenever I use any of the "CreateUnit" natives to create a unit ontop of another unit, they always spawn just a bit away. This is even true for flying units, units with no collision size and when removing the original unit before hand. Here is an example:
So yeah, how can a spawn (or move) a unit to the exact same spot as another unit, without it checking for unit pathing / collision or whatever the problem is.
JASS:
function SpawnCorpse takes nothing returns nothing
local unit dead = GetTriggerUnit()
local real x = GetUnitX(dead)
local real y = GetUnitY(dead)
local unit corpse
call ShowUnit(dead, false)
call RemoveUnit(dead)
set corpse = CreateUnit(GetOwningPlayer(dead), 'n001', x, y, GetUnitFacing(dead))
call SetUnitAnimation(corpse, "death")
call PauseUnit(corpse, true)
set dead = null
set corpse = null
endfunction
So yeah, how can a spawn (or move) a unit to the exact same spot as another unit, without it checking for unit pathing / collision or whatever the problem is.