Blast Door hinge keeps returning to original position when rotating

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.

1 Like

I’ve never worked with Tweens before so I could be completely wrong here, but is the BlastDoorHInge trying to Tween back to it’s original Position while it’s running the BlastDoorRotate Tween?

No I set it so that it just rotates

local BlastDoorRotate = TweenService:Create(BlastDoorHinge, BlastDoorRotateInfo, {CFrame = BlastDoorHinge.CFrame * CFrame.Angles(math.rad(-88.5),0, 0)
	})

Tweens will override each other. They also don’t yield, which means that if you put one tween after another, it’ll play the second tween immediately after the first, before it finishes. Short version is that you’ll need to add delays.

Also, I personally use this function every time I use tweens:

local T = game:GetService('TweenService')
function tween(o,t,l,s,d)
	if not s then s = Enum.EasingStyle.Linear end
	if not d then d = Enum.EasingDirection.InOut end
	local i = TweenInfo.new(l,s,d)
	return T:Create(o,i,t)
end

Usage:
tween(Instance,Tween Table,Tween Length Time,EasingStyle,EasingDirection)
The last two are optional.
Example:
tween(workspace.Part,{CFrame=CFrame.new(0,10,0)},1):Play()
(Multiple properties can be changed in the tween table, of course)

Im sorry, but I don’t really understand what this code does could you maybe explain it in more depth?

Essentially, it just makes it a bit easier to tween things. Which part is confusing you exactly?

1 Like

Please explain what if not s then s does

It basically checks if you put anything in for the s or d variables, which are EasingStyle and EasingDirection. If nothing is put, then resort to a default. The default I put is Linear for EasingStyle and InOut for EasingDirection.

This is misinformation you can stop tweens from overriding eachother there’s a bool value for that.

Thank you, but how would this fix the door rotating while moving back to it original position,
I can supply a video if you want to see what its doing

That’s not something in the normal tween function. That’s only for this, which is strictly for UI.

Yes, but saying that tweens can override eachother without mentioning the exception for UI tweening is wrong, you are telling him misinformation.

I feel like you’re trying to needlessly nitpick for “internet points”. This topic is clearly about part instances and not UI.

Are you sure you’ve got the Hinge point Part’s center at it’s actual rotational center, or is the Hinge point actually rotating around a point closer to the frame of the door, making it seem like it’s sliding? If you click on the Part you’ve labelled as the rotation point it should be centered on where you actually want it to rotate.

No I have two Root parts (three if you count the wheel) but I have the BlastDoorRoot slide forward, then I have the BlastDoorHingeRoot have the door rotate.

But if you click on the BlastDoorHingeRoot with the Move tool is the tool handle centered at the point you want the door to pivot around?
Same as the Handle, it pivots around the central point, but if it was set for a different point the handle would rotate around that part.

Yes, I have it where I want it to pivot, but the problem is that the pivot point moves backwards instead of staying in the same spot
Here’s a video to show what im talking about

1 Like

Like I said, I’m not familiar with Tweening, so is there anything in this line that tells the Tween service to move the door, or is it only trying to rotate the door?
local BlastDoorRotateInfo = TweenInfo.new(9, Enum.EasingStyle.Quart, Enum.EasingDirection.InOut, 0, false, 0)

local BlastDoorRotate = TweenService:Create(BlastDoorHinge, BlastDoorRotateInfo, {CFrame = BlastDoorHinge.CFrame * CFrame.Angles(math.rad(-88.5),0, 0)
	})

This code is only telling it to rotate and nothing else

I just did a little expirement and set the angle which the door will rotate at to 0 and after the specified amount of time it went back to its original position