Hello! My code is already working. I'm pretty sure that this isn't that hard to fix, but I just cant figure out what I'm doing wrong. I am new to tweening so I'm not that good at it.
I am trying to get the door to rotate around the hinge exactly, but what I currently have makes it clip through the wall.
My script (also, the CFrame.new(0, -6.146, 0) makes the hatch/door part 6 studs lower otherwise it rotates around the center of the hatch/door):
hatch = script.Parent.Hatch hinge = script.Parent.Hinge local TweenService = game:GetService("TweenService") local tweeninfo = TweenInfo.new(1.75, Enum.EasingStyle.Circular) local Open = TweenService:Create(hatch,tweeninfo,{CFrame = hinge.CFrame * CFrame.Angles(math.rad(100),0,0) * CFrame.new(0, -6.146, 0)}) local Close = TweenService:Create(hatch,tweeninfo,{CFrame = hinge.CFrame * CFrame.Angles(math.rad(0),0,0) * CFrame.new(0, -6.146, 0)}) script.Parent.Detector.Touched:Connect(function() print("Touched") Open:Play() wait(4) Close:Play() end)
Thanks for any help!