I have been making a Blast Door using TweenServices for the past hours, im wanting to make it slide and then open, so far I have completed the door sliding out then kinda rotating.
Anyways, the issue is that when the Door starts rotating to open it also starts moving back to its original position before the Door slid outwards.
I have tried to counter it with an another TweenService but it just ended back up in its original position
I have also tried moving the Hinge Root to the position where it would eventually be and it still moved back to its original position
I have no idea whats causing this and how im able to stop
Here’s my code.
--parts in workspace and model
local Wheelmid = script.Parent
local ClickDetector = script.Parent.Parent.Wheel.ClickDetector
local BoolOpenClose = script.Parent.Parent.Parent.OpenOrClose
local WheelWeld = script.Parent.Parent.Parent.BlastDoorRoot.WeldWheelRoot
local BlastDoorRoot = script.Parent.Parent.Parent.BlastDoorRoot
local BlastDoorHinge = script.Parent.Parent.Parent.BlastDoorHinge.BlastDoorHinge
local BlastDoorHingeWeld = BlastDoorRoot.WeldBlastDoorHingeRoot
--Hinge TO wall Welds
local HingeToWallWeld = BlastDoorRoot.WeldHtW
local HingeToWallWeld1 = BlastDoorRoot.WeldHtW1
local HingeToWallWeld2 = BlastDoorRoot.WeldHtW2
--Circle Hinge to Wall welds
local HingeToWallCWeld = BlastDoorRoot.WeldCHtW
local HingeToWallCWeld1 = BlastDoorRoot.WeldCHtW1
local HingeToWallCWeld2 = BlastDoorRoot.WeldCHtW2
--Hinge To Wall
local HingeToWall = BlastDoorHinge.Parent.HingeToWall
local HingeToWall1 = BlastDoorHinge.Parent.HingeToWall1
local HingeToWall2 = BlastDoorHinge.Parent.HingeToWall2
--Circle Hinge To Wall
local HingeToCWall = BlastDoorHinge.Parent.CircleHingeToWall
local HingeToCWall1 = BlastDoorHinge.Parent.CircleHingeToWall1
local HingeToCWall2 = BlastDoorHinge.Parent.CircleHingeToWall2
--game services
local TweenService = game:GetService("TweenService")
--TweenInfo's
local WheelTurnInfo = TweenInfo.new(4, Enum.EasingStyle.Sine, Enum.EasingDirection.InOut, 0, false, 0)
local BlastDoorSlideInfo = TweenInfo.new(1.9, Enum.EasingStyle.Quint, Enum.EasingDirection.Out, 0, false, 0)
local BlastDoorRotateInfo = TweenInfo.new(9, Enum.EasingStyle.Quart, Enum.EasingDirection.InOut, 0, false, 0)
--Tween Creation
local WheelTurn = TweenService:Create(Wheelmid, WheelTurnInfo, {CFrame = Wheelmid.CFrame * CFrame.Angles(0, math.rad(180), 0)
})
local BlastDoorSlide = TweenService:Create(BlastDoorRoot, BlastDoorSlideInfo, {CFrame = BlastDoorRoot.CFrame * CFrame.new(0.9,0,0)
})
local BlastDoorRotate = TweenService:Create(BlastDoorHinge, BlastDoorRotateInfo, {CFrame = BlastDoorHinge.CFrame * CFrame.Angles(math.rad(-88.5),0, 0)
})
--When clicked plays the tweens
ClickDetector.MouseClick:Connect(function()
--If door is closed it plays the open thing if door is opened it plays close thing
if BoolOpenClose.Value == false then
Wheelmid.Anchored = true
WheelWeld.Enabled = false
WheelTurn:play()
WheelTurn.Completed:Connect(function()
BoolOpenClose.Value = true
WheelWeld.Enabled = true
Wheelmid.Anchored = false
BlastDoorSlide:play()
BlastDoorSlide.Completed:Connect(function()
BlastDoorHinge.Anchored = true
BlastDoorHingeWeld.Enabled = false
BlastDoorRoot.Anchored = false
--Makes them ancored
HingeToWall.Anchored = true
HingeToWall1.Anchored = true
HingeToWall2.Anchored = true
HingeToCWall.Anchored = true
HingeToCWall1.Anchored = true
HingeToCWall2.Anchored = true
--Disables Welds
HingeToWallWeld.Enabled = false
HingeToWallWeld1.Enabled = false
HingeToWallWeld2.Enabled = false
HingeToWallCWeld.Enabled = false
HingeToWallCWeld1.Enabled = false
HingeToWallCWeld2.Enabled = false
--Plays it
BlastDoorRotate:Play()
BlastDoorRotate.Completed:Connect(function()
print("Blast Door Open")
end)
end)
end)
else
print("Else")
end
end)
Here’s a video to show what the door is doing.