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!
native SetUnitPosition takes unit whichUnit, real newX, real newY returns nothing
native SetUnitX takes unit whichUnit, real newX returns nothing
native SetUnitY takes unit whichUnit, real newY returns nothing
There are few differences, mainly:
- the first one is generally slower.
- it also performs somekind of stop-order-check and clears current order
- accounts for pathing, whereas the later two methods ignore it
Considering those, we could also say that SetUnitX/Y is kind of smoother than the position equivalent.
You can make sliding maps with with SetUnitX/Y.
You can also easily crash the game with SetUnitX/Y (there's no checking so you can push a unit out of map bounds)
Bannar explained it pretty well. But both have their advantages.
For teleport systems, where you usually don't need to check anything, SetUnitX/Y is better.
If you need to check for pathing and/or not want the unit be able to move itself while sliding, then you just can use SetUnitPosition.
Because as Bannar explained it gets "stop" order and it automatially checks for pathing.
But SetUnitX/Y is a lot fater, so it depends to your needs. Here a quote:
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.