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

How do you make a tile scrolling animation?

Asked by 3 years ago

So I was trying to make a tile scrolling animation where a pattern would scroll down forever but it won't reset the animation so it would just fly off the screen. how do I fix this?

Scroll = script.Parent

while true do
    wait()
    Scroll.Position = Scroll.Position + UDim2.new(0, 0,0.1, 0)
    print (Scroll.Position)
    if Scroll.Position >= UDim2.new(0, 0,0, 0) then
        Scroll.Position = UDim2.new(0, 0,-1, 0)
        print("Animation reset")
    end
end

1 answer

Log in to vote
0
Answered by 3 years ago

You cant compare a Position with Udim2 like that because it doesn't know exactly what u want to compare. I assume you want to compare the y scale. Replace line 7 with

if Scroll.Position.Y.Scale >= 0 then
Ad

Answer this question