- Home /
Angle to Rotate Vehicle in Scrolling in Environment
I have a scrolling game where the character's navigation (through a narrow path of obstacles) is handled for him (with A* Pathfinding free). The player simply decides the speed.
My world is set up so that obstacles can be randomly spawned at the far end of the map and moved toward him based on his speed. In other words, the only direction my pathing handles is the X-direction (around obstacles).
My problem is that I need the character to rotate with the path he is following. You may be thinking, "Why not just have the character transform.LookAt(nextWaypoint)?" But it's not that simple.
Because I am constantly updating the Grid Graph created by A* (for the moving obstacles), for whatever reason (it's a bug or some other idiosyncrasy), my Current Waypoint is constantly changing, and when I LookAt() the next waypoint, my Vehicle ends up jerking back and forth.
How can I just align my Vehicle with the Path I'm on?
Your answer
Follow this Question
Related Questions
LookAt once 0 Answers
hoe to rotate a AI as a animation 1 Answer
Making an object move in the direction the player is "facing" 2 Answers
transform.lookat() limitation... 1 Answer
Lock rotation axis? 4 Answers