Badly needed help with this. Its a very simple problem but I am not sure where I m going wrong.
Here s the case:
I have an animation for a tower of defense game that I am making.
It follows a path and on its path the character has to orient itself in the path direction. I have created Waypoints for determining the point of change in direction.
This is what I did
var nextRelativeWaypointPosition : Vector3 = waypoints[currentWaypoint+1].position - transform.position;
transform.LookAt(nextRelativeWaypointPosition,Vector3.up);
But the Character seems to take a circular path around the target.
I have tried various other functions as well using
“localrotate” “InversetransformRotation” etc to no avail.
Suggestions/corrections !!