Make door open with tween when player touches hitbox

Hi,

How do I make a door like in the video? I made it last year, but I can’t seem to find the tutorial on it.

I’m actually making a game that has doors like this. Super easy.

make a door first, and name the Base of the door “Base”. Then make a pole next to it and name it “Hinge”. Weld the base to the hinge using a weldConstraint.

Don’t forget to unanchor the base And anchor the hinge

From there, you can make as much decoration on the door as you want, as long as it is unanchored and welded to the base.

After that, make the hitbox. It should cover the entire door. Then get to scripting.

Just get TweenService and make the Hinge rotate. Like so:

local openPos = Hinge.CFrame * CFrame.Angles(0, math.rad(Number), 0)
local closePos = Hinge.CFrame

Now you just need to connect it to a touchedEvent and a touchEnded event.

3 Likes