- Home /
Help moving an object towards one it is looking at.
I have an object looking towards and object. I thought this would in turn change the z-axis to point towards that object so incrementing the z-axis would move the moving object towards the target. Needless to say it doesn't work that way. Could anyone help me move an object towards a target it is looking at? Thank you for all your help.
Answer by Peter G · Jul 23, 2011 at 03:07 AM
If the object is looking at the target, then you should just be able to do:
transform.Translate(Vector3.forward * speed * Time.deltaTime, Space.local);
Your answer
Follow this Question
Related Questions
Why is my object not following my path ?,Why is my object going through the target ? 2 Answers
Moving a object around with mouse, rotating it with arrow keys and placing it. 1 Answer
Animated Object moving when clicked 1 Answer
Player on moving object doesn't follow it Unity 5 0 Answers
making an object move up and down 3 Answers