Most games we visit have doors, each of them have their own respective way of functioning. Today I’m going to share with you my own door build!
So this is an example of the finished product. Not bad right? The best part is that it isn’t even that complicated to create yourself!
I started off by making the door and all parts which are supposed to move. This doesn’t have to be detailed, we can add those later.
Next thing I did was adding a small invisible brick in the middle of the door. Mine’s called ‘Interaction’ for logical reasons. The size of it doesn’t matter. Don’tmake the same mistake like me, and make sure that ‘CanCollide’ is turned off!
Now it’s time to group the door. When grouped, I renamed the door’s parts to something that’s easy to work with and added 2 more assets to the model: an ‘Animation’ and a ‘Humanoid’. This is because rather than programming the door’s movements, we’re going to animate it.
The door itself is not ready for animating yet. We need to turn it into a rig before we can. I used a simple plugin called ‘RigEdit Lite’.
The door is now ready to be used to animate. I used Roblox’ built-in animation editor tool.
Now we have rigged the door so it can play animations, we have created an opening and closing animation, all we have left to do is make it open when interacted with. I simply inserted a new ‘ProximityPrompt’ in the ‘‘Interaction’’ part, and another script in the ‘ProximityPrompt’. Don’t forget to put the door’s Animation ID into the Animation asset.
When we go into testing mode, we can see the interaction prompt show up. When we interact the door, nothing will happen yet. We still have to program it so it plays the opening animation upon interacted.
This is the entire script. Only 10 lines long. I’ve made it so that opening and closing is in one animation. There’s countless ways to tackle this, this is how I did it.
Now all we have to do is make the door look nice. I just started building on it, unioned the parts and welded them to their own door part.
And this is the final product. I hope this tutorial helps someone. I pasted the resources I used + a community resources version down below. Feel free to use my prebuilt model for your own games. Have a nice day!
Edit: Rather than using Humanoids, it’s better to use “AnimationControllers” performance-wise. Credit to BuilderityRBLX and grillme99 for making me aware of this!