NodeLink2 oneWay flag not working

Hello everyone.¸

I’m running in some issues with the NodeLink2 component.

We are using recastgraph to generate our navMesh. On top of it we add some NodeLinks2 for athletics actions like climbing, jumping etc… . Lately we added one way teleports ot the game. We use the nodelinks2 component and set the oneWay flag to true. Unfortunately it seems like the Pathfinding is not taking any consideration of this flag and units are trying to use teleporters in the wrong way.
Is there a way to fix this ? Should I use another NodeLink ?

Thanks for you help.

L.

Hi

Sorry, that is a dumb miss I did.

At the bottom of the Apply function in the NodeLink2 script there are a few lines which should look like this, find the previous ones (should be similar) and replace them:

`//Add connections between nodes, or replace old connections if existing
connectedNode1.AddConnection(startNode, (uint)Mathf.RoundToInt (((Int3)(clamped1 - StartTransform.position)).costMagnitudecostFactor));
if ( !oneWay ) connectedNode2.AddConnection(endNode, (uint)Mathf.RoundToInt (((Int3)(clamped2 - EndTransform.position)).costMagnitude
costFactor));

if ( !oneWay ) startNode.AddConnection(connectedNode1, (uint)Mathf.RoundToInt (((Int3)(clamped1 - StartTransform.position)).costMagnitudecostFactor));
endNode.AddConnection(connectedNode2, (uint)Mathf.RoundToInt (((Int3)(clamped2 - EndTransform.position)).costMagnitude
costFactor));`

Basically it is just the addition of the “oneWay” if statements.

Works like a charm!

Thanks for the fix and quick answer!