So I am trying to make a door be opened slightly so when the players walks through it slams shut behind them. The problem is that when I try to set the hinge’s TargetAngle to 80, the door is not even opened. I tried putting the door on flat terrain because maybe there was an invisible union in the way but even there it doesn’t work. So basically the door is stuck without any signs of movement or change.
Here are the settings.
Here is the script in the door (might be useful)
script.Parent.HingeConstraint.TargetAngle = 0
local can = true
script.Parent.Parent.SmallTunnelDetector.Touched:Connect(function()
if can == true then
can = false
script.Parent.HingeConstraint.TargetAngle = 0
repeat wait() until math.ceil(script.Parent.HingeConstraint.CurrentAngle) == math.floor(script.Parent.HingeConstraint.TargetAngle)
script.Parent.Main.bang:Play()
script.Parent.Main.close:Play()
script:Destroy()
end
end)