• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[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.
 
Level 14
Joined
Oct 18, 2013
Messages
724
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.
Top