I want to make an AI on my own and I want to know how can I make them open doors. I dont know much about scripting, so how do you make an NPC wonder around, jump over blocks, and open doors?
How can you make an NPC open doors?
1 answer
If the door opens by touch, you can make every door CanCollide false on the server, and then in LocalScripts make them CanCollide true for all players. Then, pathfinding service should automatically find its way through the doors, still making them open on touch. Otherwise, if they opened by click, you could make a ModuleScript with the code to open the door. Then, every time the NPC is moved, you could create a Region3 around it to check for adjacent doors, and then require the module to open the door.
6 comments
This is correct ????
Yea, I guess that helps? Can I make a door animation of some sort?
yes
Your telling me what scripts I need to use but not how to use them -_-
Thanks anyways!
TYY!!
This discussion is preserved as it was. New answers, comments, and votes are closed.

3 comments
you could have a block in front of npc and when the npc touches it the door slides open
How though?
Well where is the NPC trying to go to?