Automatic opening and closing door

I have been having a hard time figuring out how to make a door that opens and closes once you get in a certain range. If anyone could explain to me how to achieve this that would be great. Thank you

Basically what I’m talking about ^

you add a part near the door then when player touches it it open the door and if the touching ended then the door closes

2 Likes

You can use Region3, magnitude, or a .Touched function in a part to check when they get close to the door, then you can run the code to open the door.

1 Like

I would use a module called zone+, it is very useful for these kinds of things. Side note, if you are going to have many of these doors you should consolidate them into a single scripts and use a for loop to iterate through all the doors to connect the events.

1 Like