Can't Figure out how to make NPCs open Doors!

Hey Everyone!

I am trying to make a system where some NPCs can open doors and some other NPCs can’t.

What I want to achieve is to make the NPCs that can open doors have their pathfinding calculated beyond the door even if it’s closed, but I struggle at the part to make the door operate on both scenarios of the NPC that can open Doors and the one that cannot.

Is there a way to make NPCs that can calculate the pathfinding beyond closed doors and open them in proximity and NPCs that can’t open doors and have them as obstacles and not go beyond them?

Any suggestions would be greatly appreciated!

1 Like

first pathfind up to the enterance to the door, check if the door can be opened by that npc and if so, open the door and directly have the npc walk through without pathfinding, once clear of the door have it pathfind where it needs to go.

This is actually a very simple thing to do which people make more difficult than it needs to be. Simply add a pathfinding modifier around the door object so that the npc with pathfind through it. Then animate the door so that it opens when the npc is near. Check out the “ignoring obstacles” section in this devforum page: Character Pathfinding | Documentation - Roblox Creator Hub

1 Like