Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Custom Wait Gui Won't Work?

I'm new to coroutine.

local DoIt = true




local Dot3 = coroutine.create(function()
script.Parent.Dot3:TweenPosition(UDim2.new(.55,0,.3,0),"Out","Bounce",.1,true)
script.Parent.Dot1:TweenPosition(UDim2.new(.55,0,.4,0),"Out","Bounce",.1,true)

end)

local Dot2 = coroutine.create(function()
script.Parent.Dot2:TweenPosition(UDim2.new(.45,0,.3,0),"Out","Bounce",.1,true)
coroutine.resume(Dot3)
script.Parent.Dot1:TweenPosition(UDim2.new(.45,0,.4,0),"Out","Bounce",.1,true)
end)

local Dot1 = coroutine.create(function()
script.Parent.Dot1:TweenPosition(UDim2.new(.35,0,.3,0),"Out","Bounce",.1,true)
coroutine.resume(Dot2)
script.Parent.Dot1:TweenPosition(UDim2.new(.35,0,.4,0),"Out","Bounce",.1,true)
end)



while DoIt do
coroutine.resume(Dot1)
wait(1)
end

What i'm trying to do is, the first "Dot" is suppose to "Bounce" and when its up in the air, the second one should start to "Bounce" while the first one continues to go down. Why won't it do that? .. No Output,

The 2nd and third Rise. Then nothing happens.

1 answer

✓ Accepted answer

Coroutines are actually evil, and very misleading.

Don't use coroutines for this. TweenPosition already runs asynchronously - Try looking into the Callback parameter of the GUI Tween Functions.

4 comments

0

Calling them "evil" goes too far. This just isn't what they're for.

0

It really doesn't. They're used too often by people who don't understand how to use them. I particularly prefer people using spawn() over coroutines.

0

Ok. But maybe next time give me it on here. I'm using a laptop, using my phone as internet. It's not good, and even worse, I'm in the mountains.

0

I have to do this stuff between a family iPad with usability and speed like my grandma on DOS, and a phone that can only barely manage Opera Mini. So excuse me for leaving your job to you.

This discussion is preserved as it was. New answers, comments, and votes are closed.