How to make npc that cant go inside of certain area when pathfinding

Hi, as i said in title, i want to make npc which is cant go certain area when pathfinding (like avoiding from the area which is blacklisted). How can i do this? is there a parameter for this?

i thinks there is sufficient information on this post about pathfinding modifiers

There is something called a PathfindingModifier where you then tell the NPC if it can pass through an Area or not, and you set a Label for it (which in this example is ExampleLabel), and set its Cost to math.huge with the Paths AgentParams

Costs = {
    ExampleLabel = math.huge -- meaning the NPC will try to avoid this
}

which should look like this:

PathfindingService:CreatePath({

    -- look into other Params
    Costs = {
        ExampleLabel = math.huge
    }
})

If you want them to go through an Area, just set the Cost to a lower amount

1 Like