Jump to content
Sign in to follow this  
KaRRiLLioN

Setdir so unit faces an object

Recommended Posts

I want to set the direction of an object so it always faces the direction of another object regardless of where they are in relation to each other.

What calculation can I use to accomplish this?

Share this post


Link to post
Share on other sites

not tested:<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_objA setDir (asin ((position _objB select 2)-(position _objA select 2)/(_objA distance _objB)))

Share this post


Link to post
Share on other sites

Hmm, I seem to get a direction between 4 and 10 degrees with that.

Wish I could remember more of my Trig lessons from college.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×