I am trying to learn how to use the PathFinding service but I am having some issues with the cost. In this clip I set the cost of the plastic to 100 and the pavement to 1 so I would like it to be on the pavement as much as possible yet it seems to comer at the pavement at an angle rather than trying to get to it as fast as possible. I have the radius set to 4 and I was wondering if there is anything I can do to fix this?
#Pathfinding Cost Help
1 messages · Page 1 of 1 (latest)
"The diagonal movement happens because PathfindingService calculates the shortest mathematical path based on the costs you provided. Since the 'Plastic' cost isn't infinite, the AI decides that cutting the corner is technically cheaper than walking a longer distance to reach the pavement perpendicularly.
To fix this try dis
• Increasing the cost: Set Plastic to math.huge to force it to stay off that material entirely.
• Agent Radius: Lower your radius (currently 4) to see if it allows for tighter turns toward the pavement.
• Waypoints: Use CreatePath with WaypointSpacing set to a smaller number for more frequent path corrections."
Would you like me to provide a code snippet for how to correctly set those costs in your script?
Thank you for the help. It seems like math.huge is making it completely avoid the plastic so that it doesn't even want to jump over it or climb onto the tower that I made. Lowering the radius did seem to help a bit though
Also still seems to take the shortcut even with a very small waypoint spacing setting