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

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

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?

1 comment

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.

1 answer

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

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