Hi Aron
I’m using Grid Graph.I have simple AI script. Avatar does not use the Character Controller, I would like to know how to get Vector3 of the next node of the path. I want to use this value in the “transform.LookAt” function because Avater does not adjust properly to the direction in which he walks.
I guess that is easy but I can not find it anywhere
Maybe there is some other way to do it?
private void OnPathComplete (Path p)
{
if (!p.error)
{
_Path = p;
currentWaypoint = 0;
}
}
private void PathFinderMove()
{
if (_Path == null) return;
dir = (_Path.vectorPath[currentWaypoint]-transform.position).normalized;
dir *= PF_Speed * Time.fixedDeltaTime;
transform.Translate(dir);
transform.LookAt("here I need vector3 value of the next Node");
if (Vector3.Distance(transform.position,_Path.vectorPath[currentWaypoint]) < nextWaypointDistance)
{
currentWaypoint++;
return;
}
}
Thx for help