Quantcast
Channel: Answers by "lodendsg"
Viewing all articles
Browse latest Browse all 102

Answer by lodendsg

$
0
0
To find the heading to any vector from another its simply

heading = subject - self;

So the heading vector (a vector which is in the direction of the subject from your self and has a length equal to the distance between you and the subject ... would be
var heading = enemy.position - player.position;

You can now set your target position according to that direction e.g. var targetPos = enemy.position + (heading.Normalized * followThruDiistance);

Viewing all articles
Browse latest Browse all 102

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>