Need help with tween

so ive been using tweens for alot for my game and i needed for te water to raise instead of go down and i put all of the right positions and it still wont work here is the vid Watch robloxapp-20240901-0744141 | Streamable

code:

while task.wait(0.5) do
	if 	game.ServerStorage.TI.Value >= 50 then



		local raisetween1 = tweenService:Create(game.Workspace.Water.layer1, TweenInfo.new(5, Enum.EasingStyle.Linear, Enum.EasingDirection.Out), {Position = Vector3.new(2751.9, 73.473, 93.497)})
	raisetween1:Play()
		local raisetween2 = tweenService:Create(game.Workspace.Water.layer2, TweenInfo.new(5, Enum.EasingStyle.Linear, Enum.EasingDirection.Out), {Position = Vector3.new(2752.015, 6.088, 91.206)})
			raisetween2:Play()
		local raisetween3 = tweenService:Create(game.Workspace.Water.layer3, TweenInfo.new(5, Enum.EasingStyle.Linear, Enum.EasingDirection.Out), {Position = Vector3.new(2747.515, -128.912, 91.833) })
	raisetween3:Play()

		print("dsf")

	end

end

2 Likes

Make sure that the starting position is layer than the tween goal position if you want it to go up

1 Like

? i dont get it explain it again

1 Like

If its going down, means you have your calculations wrong, Instead of setting it to a specific position, get the water part (or whatever your using) position and add a vector3 on the y axis, like this

tweenService:Create(game.Workspace.Water.layer1, TweenInfo.new(5, Enum.EasingStyle.Linear, Enum.EasingDirection.Out), {Position = game.Workspace.Water.layer1.Position+Vector3.new(0, 10,0)}):Play()
1 Like

maybe try changing

Enum.EasingDirection.Out

with

Enum.EasingDirection.In

and if you are using a while loop to make the tween play forever you can add true as inverse in the tween arguments and -1 at number of loops to make it play forever instead

1 Like

i did try doing that but the results didnt change

2 Likes

i canot open the vid u send . does the water go down instead of going up or it doesnot even work? or do you want it to raise and go down?

goes down instead of up so yeah

1 Like

works now but it goes over 10 help?

1 Like

its because you have a while do loop

2 Likes

thx geoe and jacob helped me fix this

2 Likes

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