- Home /
Turning an object towards point
I'm trying to create a basic ai entity that will only move in x and z coordinates. The only thing I need it to do is to turn towards a point as well as accelerate and decelerate.
I tried this:
Quaternion lookie = Quaternion.LookRotation(point-transform.position);
transform.rotation = Quaternion.Slerp(transform.rotation, lookie, Time.deltaTime * turnSpeed);
And the entity turns towards the point but if it moves around the point it wont keep turning once set.
I tried getting the angle between current forward vector and target and depending on the results use transform.rotatearound but got weird results and need some help on how to proceed.
Your answer
Follow this Question
Related Questions
Random direction with Mouse Click... 2 Answers
How can I get an object to intercept a moving object's path? 3 Answers
How can I draw a ray for direction object is moving? 1 Answer
Most Efficient Method for Steering for Vehicle AI 1 Answer
How do I make my AI move and follow me once I am close enough. 0 Answers