NavMesh Road System

Hi, i’m making a an road system with car AI and it’s working fine, but the problem here is that when NavMesh agent calculates a path to a point it calculates the fastest way going on the wrong road direction, i tried to use a off-mesh link but doesn’t seems to work right any one has an ideia?

1 Like

I do have an ideia but it makes me creating a script that stores a parent and on the end of intersection on colliding it set’s the NavMesh agent destination to the cube, but is there any better ideias.

No

You could try adding a sequence of waypoints onto your track. These waypoints would be arranged along the correct side of the road and your cars would follow them in sequence. You could still use the navmesh for pathfinding but the cars would calculate a path to the nearest waypoint thats next in the sequence.

1 Like

Yes that is what i’m trying, it’s working i disable the auto braking then save the destination on a temp Vector3 give the position of the checkpoint as destination and before he gets to the checkpoint i give him back the original destination and enable again the auto braking, now i’m trying to know when he actually wants to turn right or move forward i’m looking at Navmesh Agent Path that contains a list of way points where the agente changes direction i’ll keep this updated.

P.S. I disable auto braking so that agent doesn’t stop moving when giving him a new destination :wink:

Hi @Martins74 I have very similar problem to yours. Would you share what was your solution if you made it work please?