Hello,
do you know where the problem could be? The platform is with NodeLink2 component with its own transition. I absolutely do not know where the error could be, everything is set up well. What should I focus on to solve it?
Sure…
I found out that there is a problem with my customTraverse …
My situation is that as soon as onTraverseOffMeshLink is triggered, I want it to go directly to the point where LinkNode2 starts, but it either fails there (because it can’t go there and the result is walking away, I already had to increase the distance so that it could at least somehow detect those who go “outside”, but it’s not as I imagined)
print($"[ENEMY] {name} -> traverse: start");
isTraverse = true;
actualSpeed = 0.5f;
ai.maxSpeed = actualSpeed;
var info = AstarPath.active.GetNearest(special.first.position);
if (info.node == null || !info.node.Walkable)
Debug.LogWarning($"{name}: Nearest node to special.first.position is NULL or not walkable.");
ai.destination = info.position;
ai.SetPath(null);
yield return null;
ai.SearchPath();
print($"[ENEMY] {name} -> traverse -> moving to link");
while ((Vector3.Distance(ai.position, info.position) > 0.5f))
yield return null;
print($"[ENEMY] {name} -> traverse -> move2Link -> end");
This is the part of the code where it crashes (while)
I’m a complete beginner, so I don’t know if I’m solving it correctly, even why the traverse starts far before the point for Link
Then there is another problem, but it is not related to this, but it looks like a bug in the RichAI component with rotation → my code forced it, but when I let the component calculate it, the enemy in the gameView does not rotate like when I have the sceneView + gameView active