How to make a working door - Difficulty 2/10

Credit

I did get inspired by this post, but my door uses a completely different approach to the door.

Making the Door

To get started, place 2 wooden poles (our doors) like this
image
Now hide the tilted one by default. I did not include this in the photo but It is advised to add a barrier to prevent collision bugs

Adding the code

To begin, we will add an invisible button to the center of the doors like this:
image

For our code, let’s add a new boolean property name isDoorOpen? with default value as false

To hold our code, let’s create a new trigger. This will contain our toggle.
Add a new script that runs on trigger. This is the code that will toggle our door:
image

The last step is to add this to the open door:

And this to the closed door and the barrier:
image

Final Result

ezgif.com-video-to-gif (1)

Bonus Section

This section will contain bonuses that can add to this project.

#1 - Sliding Door

As recomended by:

You can make a sliding door by simply moving the tilted door for when the door is open to horizontal and positioned like this:
image

11 Likes

AWESOME! This reminds me of how doors look on blueprints. This is such a cute idea!

6 Likes

Awesome,man! I’ll be sure to use this!

2 Likes

This is an amazing guide! I love the way the door works. Thanks for crediting me for the inspo!

2 Likes

This is a great guide! I like how you can open and close the door, non have ever done that.

1 Like

I have an idea for an improvement. You could add buttons on both sides that activate a different prop so that it looks like it’s swinging in the direction that your walking in.

1 Like

Maybe create a part two of the guide for sliding doors?

3 Likes

Great project! I would love to use this in the future.

3 Likes

This is pretty cool!

1 Like

Actually, that was the original idea until I remembered that most doors only open one way

That would be cool! I may make an update

3 Likes

Bump, also, I found a better way to do this

BUMP, you don’t need block code, it uses too much memory, just have two buttons.

i just like block code tbh

1 Like

just realised, the problem with 2 buttons is they would have to be in range of each other. it would break if the user finds a spot where they can press both at the same time.

You can deactivate the other buttons.

DO you need blocks I think there might be an easier way I don’t know?

There is an easier way, follow any of the other guides. Those don’t use blocks.

Yeah I know how to do it I am just saying

i just prefer using block code since its funner

2 Likes