When I first click the button only one tween works (tween 2)

  1. I want primarypart and body to tween at the same time.

  2. On the first click, only the body tweens. https://gyazo.com/e67926b91af675ac9ca2578f5cac7fb7

  3. Looked on the forums and could not find anything relating to this.

test.MouseButton1Click:Connect(function()
	if not debounce then
		debounce = true
		if not open then
			local goal = {}
			goal.Position = openPos
			local tween = TS:Create(PrimaryPart, TweenInfo.new(1), goal):Play()
			local goal2 = {}
			goal2.Position = cargopos
			local tween2 = TS:Create(body, TweenInfo.new(1), goal2):Play()
			wait(1)
			open = true
		elseif open then
			local goal = {}
			goal.Position = closePos
			local tween = TS:Create(PrimaryPart, TweenInfo.new(1), goal):Play()
			local goal2 = {}
			goal2.Position = carbackpos
			local tween2 = TS:Create(body, TweenInfo.new(1), goal2):Play()
			wait(1)
			open = false
		end
		debounce = false
	end
end)
1 Like

Try this: How can i get multiple tweens to play at the same time using my existing code? - #6 by Shenoy6

Still does the same thing shown in the gyazo clip.

1 Like

Try setting the Tweens first, then play them at once like this example: How to make 2 parts tween at the same time - #7 by Imaginalities

1 Like

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