While using the Pathfinding Service every time I wanted the NPC to walk to a part it would try to leave the racetrack and go around it. I did some research and found it was probably from the navigation mesh, anyone know how to fix this?
Have you tried messing with the costs of traversing outside of the racetrack? Looking at PathfindingService.CreatePath, the agentParameters
supports a Costs
key which is defined as:
Table of materials or defined PathfindingModifiers and their “cost” for traversal.
Setting the costs extremely high outside the racetrack may make PathfindingService only generate paths within the racetrack.
Yes, I did Sand = math.huge for the custom properties but it still path finds to the sand
Hmm… that’s strange. Do you have a video of the behavior?
I tested the script on the racing game roblox provides and it works their. Is there any way I put the models into my game wrong?
That could be a possibility. I haven’t seen the racing game Roblox provides so I can’t really comment on how they do it. I also haven’t personally worked that much with PathfindingService
so I’m not sure where else the issues could be.
I’ll experiment some more, but thanks for trying to help