Whole button wont tween down (welded)

Code:

local CS = game:GetService("CollectionService")

local Storage = script.Parent

local TS = game:GetService("TweenService")

local TweenStyle = TweenInfo.new(0.5,Enum.EasingStyle.Sine,Enum.EasingDirection.InOut)

Storage.ChildAdded:Connect(function(Child)
	
	if Child:HasTag("ExplosiveButton") then
		
		local ButtonProximityPrompt = Child.Main.ProximityPrompt
		
		ButtonProximityPrompt.Triggered:Connect(function(plr)
			
			if not Child.Activated.Value then
				
				Child.Activated.Value = true
				
				ButtonProximityPrompt.Enabled = false
				
				Child.Main.Position = Child.Main.Position - Vector3.new(0,Child.Main.Size.X,0)
				
				task.wait(1)
				
				Child.Main.Anchored = false
				
				local WeldConstraint = Instance.new("WeldConstraint")
				WeldConstraint.Parent = Child.Main
				
				WeldConstraint.Part0 = Child.Main
				
				WeldConstraint.Part1 = Child.Base
				
				local Tween = TS:Create(Child.Base,TweenStyle,{Position = Child.Base.Position - Vector3.new(0,Child.Main.Size.X + Child.Base.Size.X,0)})
				Tween:Play()
				
				Tween.Completed:Wait()
				
			end
			
		end)
		
	end
	
end)

The issue is that only the Base part is tweened down whilst the part that is welded to the Base which is the Main is not tweened and we can see I DID unanchor it

1 Like

Help with tweening a parts rotation You have to tween with CFrame, not Position.

It worked! But I want to know whats the difference

CFrames carry rotation properties as well, not only position. Regarding why it deletes the welds if you tween with position, I have no clue.

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