Issue With NodeLink2 & Teleporting

Hello,

My agents are using Rich AI and I am using a single RecastGraph. I have a stage that is too tall for an agent to move on top of, but the top is walkable. I used the NodeLink2 script to create a connection from the floor to the stage. I then overwrote the onTraverseOffMeshLink callback to trigger a RichAI.Teleport(location, true), which moves the agent on top of the stage (or vice versa).

All of this is working, but what I am having trouble with is after the teleport the agent’s pathing is not working correctly. When I tell the agent to move around on the stage, they instead move back to their teleport location (top of the stage) and will not move anywhere else. It’s almost as if they are trying to climb off the stage.

If I spawn an agent on top of the stage, they can move around the top of the stage just fine, but if I have them take the node link off the stage, I run into the same problem. They keep pathing to the teleport location (bottom of the stage).

I’m wondering if anyone has had this problem? Any help would be appreciated.

You shouldn’t call Teleport from the onTraverseOffMeshLink callback. Just set the transform’s position to the end of the link and return from the coroutine. If you Teleport, the agent will have to clear its current path which is not necessary. Though it shouldn’t cause it to go back down, I think…