Another embarrassing question showing that I’m missing some of the basic scripting fundamentals:
I have a folder with many bubbles that I would like to have tween up and down slowly. They are all in a folder ‘CollectBubbles’.
My current script won’t work because my loop inside of a loop means that only one of the bubbles in the folder tweens because the interior while loop prevents the pairs loop from moving onto the next bubble in CollectBubble.
for i, v in pairs(CollectBubbles:GetChildren()) do
while true do
local goal = {}
goal.Position = v.Position + Vector3.new(0,.5,0)
local tween = TweenService:Create(v, tweenInfo, goal)
tween:Play()
wait (2)
local goal = {}
goal.Position = v.Position + Vector3.new(0,-.5,0)
local tween = TweenService:Create(v, tweenInfo, goal)
tween:Play()
wait(2)
end
end
Appreciate a nudge in the right direction. Thanks folks.