Quantcast
Channel: Questions in topic: "enemy"
Viewing all articles
Browse latest Browse all 1488

How to find the direction to translate an object, to move towards a point, regardless of rotation?

$
0
0
I have two objects. A and B. A moves around freely (A player.) B is an object which simply moves around based on a 'movement vector" , that is, a "horizontal" and "vertical" vector (NOT one fed in by the keyboard). So, naturally, that "movement vector" is relative to B's rotation (i.e, "(0 , 1)" will move it forward) I need to calculate that "movement vector" based on a "destination node" (which is calculated by a timer). I could just say "look at the node, and move forward" But, I need B to move towards the node even if its transform.forward changes. I thought I just needed to multiply a direction vector by transform.forward of B. But I'm dumb! Thanks in advance for any help.

Viewing all articles
Browse latest Browse all 1488

Trending Articles



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