- Home /
Point character at next waypoint
I'm using a pathfinding library to move my character. It's moving along the path great, but now I want to point the character at the next point to move to. I have a model and character controller. The code used to move the character controller (which works) is:
//Direction to the next waypoint
Vector3 dir = (path.vectorPath[currentWaypoint]-transform.position).normalized;
dir = speed Time.fixedDeltaTime; controller.SimpleMove (dir);
When the model is standing upright the rotation is 270,0,0. This is a purchased model so there must be some coord system issue and Unity must automatically fix that by rotating it 270 for me because I didn't do that. But how can I get my model to point to the direction my controller is moving but only on the Y axis?
Thanks!
Your answer
Follow this Question
Related Questions
how to create a waypoint? 2 Answers
Help with a simple AI 2 Answers
Waypoint system: loop and back-forth operations 1 Answer
Random Running and Follow at Certain Distance 0 Answers
move a gameobject in steps according to list of times 1 Answer