• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • ✅ The POLL for Hive's Texturing Contest #33 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!

Facing Angle

Status
Not open for further replies.
Level 12
Joined
Mar 13, 2012
Messages
1,121
Ok, countless hours were spent to come to the final conclusion that its just not possible. I tried everything that came to my mind, which was a lot..

Those turning functions can turn the unit instantly, the problem is that there will always be an animation of turning.

Best you can do is to transform your hero via this to a 0 ms unit, and then turn it like you would turn a building like this
JASS:
function SetImmovableUnitFacing takes unit u, real a returns nothing
    call SetUnitPosition(u, GetUnitX(u), GetUnitY(u))
    call SetUnitFacing(u, a)
endfunction

The backdraw of this method is that you have to wait ~0.5 seconds to transform your hero back to its original state, else you will see the parts of the turning animation.
 
Level 13
Joined
Oct 10, 2009
Messages
439
Eh, the way I remember working around this was using the "Unit custom value" or a hashtable to store the units implied facing angle, that way I could use it to calculate everything based off that angle.

I'm not sure if this is too relevant tho
 
Status
Not open for further replies.
Top