Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do I make a frame-by-frame decal animation in a screen gui?

Asked by
areci 5
4 years ago

I'm a total noob at scripting so forgive me. i'm still learning!

What i want to do is have a static overlay frame by frame using decals, and i have already uploaded 75 frames of decals to possibly loop onscreen. So far i have come up with this as i am just testing right now;

while true do
script.Parent.Image="http://www.roblox.com/asset/?id=4302136046"
wait(0.065)
script.Parent.Image="http://www.roblox.com/asset/?id=4302136461"
wait(0.065)
script.Parent.Image="http://www.roblox.com/asset/?id=4302136877"
wait(0.065)
script.Parent.Image="http://www.roblox.com/asset/?id=4302137343"
wait(0.065)
script.Parent.Image="http://www.roblox.com/asset/?id=4302137708"
wait(0.065)
end

the parent of this script is an ImageLabel inside of a normal ScreenGui, all inside of the StarterGui.

What am I doing wrong, and what can I do to fix this and make a frame-by-frame decal animation onscreen in a gui?

0
I highly encourge you to merge all of your 75 decals into a single one. Your game isn't going to be able to load all of those decals at once. ScuffedAI 435 — 4y

1 answer

Log in to vote
-1
Answered by 4 years ago

Your while loop is running every tick, which is setting the image to "http://www.roblox.com/asset/?id=4302136046" every tick

a fix for this would be

while wait(0.065 * 5) do
script.Parent.Image="http://www.roblox.com/asset/?id=4302136046"
wait(0.065)
script.Parent.Image="http://www.roblox.com/asset/?id=4302136461"
wait(0.065)
script.Parent.Image="http://www.roblox.com/asset/?id=4302136877"
wait(0.065)
script.Parent.Image="http://www.roblox.com/asset/?id=4302137343"
wait(0.065)
script.Parent.Image="http://www.roblox.com/asset/?id=4302137708"
wait(0.065)
end

this above only executes the code every (0.065 * 5) seconds

0.065 = your delay

5 = amount of images

Ad

Answer this question