• 🏆 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!

[JASS] Mathlike question with changing unit facing

Status
Not open for further replies.
Level 19
Joined
Oct 12, 2007
Messages
1,821
Hey there.

What would be the best way to change a unit's facing in a way that it's facing a unit in JASS.

I coded an ability for the unit, but I'm having doubts on changing his facing the right way.

call SetUnitFacing(caster,a)
We have unit called 'target' and this is the unit the unit called 'caster' should face. a is facing of the unit, and is very dependant on the 'target'.

What would you suggest? Guess I'm a bit stuck in my head atm haha.
 
Level 19
Joined
Oct 12, 2007
Messages
1,821
I suggest you at the times like this to make a similar trigger in GUI turn it to text and copy it's code :) It's the fastest way to learn function names without having to wait hours :)

Doing that will result into tons of BJ's hmm..
And with the Unit - Make Unit Face Angle command for GUI I can't even do it since my mian question is more math oriented then GUI/JASS oriented.
 
Level 19
Joined
Oct 12, 2007
Messages
1,821
in GUI look for Math-Angle between positions and set the first to the caster the 2nd to the target :) There will be how to call the warcraft script that can calculate it for U :D

Ah oke thanks man!
Didn't know about the 'Angle between points' gui function.

solved:)
 
Status
Not open for further replies.
Top