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

Trying to make a ImageLabel Animation?

Hello Im trying to make a ImageLabel Animation And I dont know why this doesnt work Please Help!

script.Parent.Image = 'rbxassetid://188837344'

1 answer

I believe the only reason why the animation doesn't work is because that's not an animation. That's just a statement setting the Image to that ID.

What type of animation do you want to do? Frame animation, or GUI Tweening?

Frame Animation:

The image "moves" with closely-related images displayed in a sequence.

Example 1: Click to animate

sp = script.Parent

function Animate()
sp.Image = "rbxassetid://60832050"
wait(.1)
sp.Image = "rbxassetid://60832071"
wait(.1)
sp.Image = "rbxassetid://60832077"
wait(.1)
sp.Image = "rbxassetid://60832081"
wait(.1)
sp.Image = "rbxassetid://60832083"
wait(.1)
sp.Image = "rbxassetid://60832090"
wait(.1)
sp.Image = "rbxassetid://60832094"
wait(.1)
sp.Image = "rbxassetid://60832099"
wait(.1)
sp.Image = "rbxassetid://60832106"
wait(.1)
sp.Image = "rbxassetid://60832113"
-- etcetera
end

script.Parent.TextButton.MouseButton1Click:connect(Animate)

Example 2: Continuously animate like a GIF

sp = script.Parent

while true do
sp.Image = "rbxassetid://60832050"
wait(.1)
sp.Image = "rbxassetid://60832071"
wait(.1)
sp.Image = "rbxassetid://60832077"
wait(.1)
sp.Image = "rbxassetid://60832081"
wait(.1)
sp.Image = "rbxassetid://60832083"
wait(.1)
sp.Image = "rbxassetid://60832090"
wait(.1)
sp.Image = "rbxassetid://60832094"
wait(.1)
sp.Image = "rbxassetid://60832099"
wait(.1)
sp.Image = "rbxassetid://60832106"
wait(.1)
sp.Image = "rbxassetid://60832113"
wait(.1)
-- etcetera
end

Tweening:

The animation (moving or resizing) of a frame or any other GUI object elements that can be displayed on the screen.

Example:

script.Parent.Frame:TweenPosition(UDim2.new(1,0,1,0), "Out", "Quad", .5, true)

Formula:

[GUI Object]:[TweenType](UDim2.new([X Scale], [X Offset], [Y Scale], [Y Offset]), "[EasingDirection]", "[EasingStyle]", [Time], [AbleToOverride])

1 comment

0

You can also use a 'spritemap' image and set the ImageRectOffset in the script.

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