Why doesn't this tween work as intended?

here is the script:

local ts = game:GetService("TweenService")
local water1 = workspace._Water2
local water2 = workspace._Water1
local ti = TweenInfo.new(10,
	Enum.EasingStyle.Sine,
	Enum.EasingDirection.Out
)
local ti2 = TweenInfo.new(5,
	Enum.EasingStyle.Sine,
	Enum.EasingDirection.Out
)
local tg = {Position = Vector3.new(water1.Position.X, water1.Position.Y -25, water1.Position.Z)}
local tg2 = {Position = Vector3.new(water2.Position.X, water2.Position.Y -13, water2.Position.Z)}
local tg3 = {Position = Vector3.new(water1.Position.X, water1.Position.Y +25, water1.Position.Z)}
local tg4 = {Position = Vector3.new(water2.Position.X, water2.Position.Y +13, water2.Position.Z)}
local tc = ts:Create(water1, ti, tg)
local tc2 = ts:Create(water2, ti2, tg2)
local tc3 = ts:Create(water1, ti, tg3)
local tc4 = ts:Create(water1, ti2, tg4)
local debounce = false
local valve = workspace.Valve
valve.ClickDetector.MouseClick:Connect(function()
	if debounce == false then
	debounce = true
	valve.SqueakSound:Play()
		valve.SqueakSound.Ended:Connect(function()
			tc:Play()
			tc2:Play()
			tc.Completed:Connect(function()
				task.wait(5)
				tc3:Play()
				tc4:Play()
				debounce = false
			end)
		end)
	end
end)

it’s not supposed to go sideways. i tried CFrame. i have absolutely no idea why this happens. water2 doesn’t go up. only water 1 and it bugs out and moves sideways and way higher.

1 Like

Have u tried doing it like that ?

local tg = {Position = water1.Position + Vector3.new(0,-25,0)}

and replace task.wait() with wait() cuz i hade bad experience using tak.wait() with tween

i haven’t, and task.wait() is wait but better.

Did u check the output ? there might be errors

still acting weird. maybe i need to make different infos for them?

wait can u show how water1 looks? cuz tweening size varies depending on shapes


i got confused rn tbh, can u tell me what is happening in vid1 and vid2 pls

the water moves sideways ISN’T IT OBVIOUS?

so the problem is in vid 2 right ? which tween does it use ?

the water shown in the videos is water1. water 2 doesn’t rise again.

ok so what is water’s shape ? u didnot tell me

it’s a normal part. characters

Do you have sizing tween? .characters

1 Like

nope. sorry for delayed response.

honestly idk where the problems is, cuz the script seems correct

1 Like

I’m presuming these lines might have influenced the attitude of your script:

local water1 = workspace._Water2
local water2 = workspace._Water1

local tc4 = ts:Create(water1, ti2, tg4)

I don’t see any other wrong stuff. You might have confused variables by naming them from my perspective.

1 Like

came back and somehow no one noticed tc4 was referencing the wrong variable. i had a brain blast lol.

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