How do I make a door that pushes open when you walk into it

So I would like to make a door that pushes open as you walk into it. I have seen that this system has been done in games like The Wild West. I know ROBLOX has a tutorial on a hinge constraint version but is there a way to do it with tweens? I have a feeling that The Wild West uses tweens instead of the hinge constraint. If this is possible using a script I would love to know how I would go about doing this.

2 Likes

Yes! it is absolutely possible with tweens.
You just have to detect using the touched function when a humanoid touched the door to open it.
Example:

script.Parent.Touched:Connect(function(p)
if p.Parent:FindFirstChild("Humanoid") then
game.TweenService:Create(script.Parent,TweenInfo.new(1),{CFrame = script.Parent.GoalPart.CFrame}):Play()
wait(1)
game.TweenService:Create(script.Parent,TweenInfo.new(1),{CFrame = script.Parent.GoalPart2.CFrame}):Play()
end
end)

Now you can’t get the exact quality of a hinge, but it works pretty fine.

3 Likes

I mean a system more like this

In the video the door only opens as much as the player is walking through it.

1 Like

you could maybe use constraints without any code

1 Like

That uses exactly constraints, its not tweening

5 Likes

you could use a hinge constraint then a spring constraint

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.