Npc not walking a path

Now I added some cost to a path for the npc

 local path = PathfindingService:CreatePath{
			AgentRadius = 1,
			AgentCanJump = false,
			Costs = {
				
				Center = 0.1,

I added a part that goes in the center with a pathfinding modifier “Center”, now I can’t get the npc to take that “Center” route. It always goes the shortest path how it likes.
Now , I can’t just add pathfinding modifiers all around with high cost values for the npc to stop going near them.

1 Like

I would recommend to take a look at roblox pathfinding archive, im sure it will help you out with your problem.

1 Like

Their help is what this is based off of.

im assuming you have a part going down the center, instead of a part at the end of the center

the way I think of weights is like conveyors, the very very low weight results in a “faster” time. its like you see a conveyor in the way you want to go. you find it would be much faster to take the conveyor than to walk straight to the target. (technically the npc sees the lower weights as blocks that makes them faster)

The same can be said with very high weight values, the npc sees it as thick sludge that would take ages to walk through

Now, I have a thing where the npc can’t possibly take the longer path and it has to take the shorter path, it will always go the shorter one. I know this is probably something very custom but how do npc’s in games go almost like in a grid? Found an example in this game

that appears to be a custom pathfinding algorithm using a grid and A*

(or just random movement idk)