Animate UIGradient

Hi, how would I animate a UIGradient on a Gui?

Please tell me if this is in the wrong category. Thanks!

you could change the offset of it transitioning it into a solid color or change the color sequence

do I use while loop or tweenservice to animate the UIGradient?

What specifically are you looking to do when you say you want to “animate” a UIGradient? In most cases TweenService should work just fine.

A simple search would have helped answer this question.

Comes with a sweet deal package tutorial, explaining thoroughly how to animate UI Gradients.
Also provides the scripting, open source files and videos/gifs for you to experiment with.

Hope this helped.

1 Like

how would I tween a rainbow UIGradient?
image

There should be a Vector2Offest” value for it. It controls how much offset there is from 0, 0, on the X and Y axis. Here’s a quick example I made:

local TweenService = game:GetService("TweenService")
local Gradient = --[[the path to the UIGradient instance here]]

local function Tween()
    local Info = TweenInfo.new( --[[put your info on how you want it to tween here]] )
    local FinalTween = TweenService:Create(Gradient, Info, {Offset = Vector2.new( --[[put how much offset you want]] )})
    FinalTween:Play()
end

Tween()

If you want it to reverse and repeat infinitely, set the Reverses boolean in Info to true, and set the RepeatCount to -1.

This forum explains what you’re trying to do - I think?
The video provided is what’s expected.
Might not be the best solution but it’s what I have found.

1 Like

true. let me cook fr so I can cook fr fr