[General] Move Instant vs. Get X/Y

Status
Not open for further replies.
Move Instant moves the unit while Get X/Y retrieves their respective coordinates (X or Y position).
 
I think question is related to:
JASS:
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.
 
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:
TriggerHappy said:
SetUnitPosition

~90% slower than SetUnitX & SetUnitY
https://www.hiveworkshop.com/forums/lab-715/jass-benchmarking-results-245362/

Edit by WaterKnight:


Or you only want to change facing? There exists a function for it, only to change the unit's facing. In GUI and also a native for jass.
  • Unit - Make Unit Face ...

native SetUnitFacing takes unit whichUnit, real facingAngle returns nothing
 
Last edited:
Status
Not open for further replies.
Back
Top