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

Why wont my frame animation script work? Please help.

Asked by 6 years ago
Edited 6 years ago

I'm trying to animate something by using frames of animation. Aka unions that are named Frame 1 Frame 2 Frame 3 Frame 4 And Frame 5. But when i join the game it wont animate and it just vanishes. And it is anchored yes. But i was walking around and i collided with it. So i know it exists its just that it doesn't want to work. I'm thinking it isn't looping.

Frame1 = script.Parent["Frame 1"]
Frame2 = script.Parent["Frame 2"]
Frame3 = script.Parent["Frame 3"]
Frame4 = script.Parent["Frame 4"]
Frame5 = script.Parent["Frame 5"]

while true do
Frame1.Transparency = 0
Frame1.Transparency = 1
Frame2.Transparency = 0
Frame2.Transparency = 1
Frame3.Transparency = 0
Frame3.Transparency = 1
Frame4.Transparency = 0
Frame4.Transparency = 1
Frame5.Transparency = 0
Frame5.Transparency = 1
end

1 answer

Log in to vote
0
Answered by 6 years ago

Add waits into your loop. It'd be something like this :

while true do
    wait(.1)
    Frame1.Transparency = 0
    wait(.1)
    Frame1.Transparency = 1
    wait(.1)
    Frame2.Transparency = 0
    wait(.1)
    Frame2.Transparency = 1
    wait(.1)
    Frame3.Transparency = 0
    wait(.1)
    Frame3.Transparency = 1
    wait(.1)
    Frame4.Transparency = 0
    wait(.1)
    Frame4.Transparency = 1
    wait(.1)
    Frame5.Transparency = 0
    wait(.1)
    Frame5.Transparency = 1
end

You can change the values in the waits if you want it to go slower or faster.

Ad

Answer this question