[JASS] Spawning a unit exactly at the same spot as other unit

Status
Not open for further replies.
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:

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.
 
try setting a timer for 0.01 seconds or something after they are created. After that timer expires, move the units. I could check if this doesn't work, because I remember doing little permutations to try and solve the same issue.
 
Status
Not open for further replies.
Back
Top