🏆 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!
function SetImmovableUnitFacing takes unit u, real a returns nothing
call SetUnitPosition(u, GetUnitX(u), GetUnitY(u))
call SetUnitFacing(u, a)
endfunction
By the way, do you know how to get the angle towards which a spell was casted (it's casted by a building so I can't use GetUnitFacing(GetTriggerUnit()).
You want to get alpha. Opposite is y difference, adjacent x difference. Tan alpha is opposite divided by adjacent, so take arctan from that. Atan2 ensures that there is no division by zero.
It can also be done by Action: Unit - Make (Your building) <gen> face (your choice) degrees facing over (your choice) seconds
You will be the one to select it's events and conditions. Hope it would help.
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.