• 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.

[General] Move Instant vs. Get X/Y

Status
Not open for further replies.
Level 22
Joined
Sep 24, 2005
Messages
4,821
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
http://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.
Top