Help needed on UIGradient

Hey, there

I have managed to use my own custom font by following this tutorial: Rbx_CustomFont Font creation tutorial - YouTube
But I want to make my TextLabel more fancy, by adding a Flowing Rainbow UIGradient on my custom TextLabel.

The effect I want to achieve on my text: (Mind that I want the effect applied on the text itself, not on the background, as show here) RainbowGradient_GIF
The directory:
image
But it just doesn’t seem to work, my TextLabel isn’t affected by the UIGradient.

-- My LocalScript inside the TextLabel
local button = script.Parent
local gradient = button.UIGradient
local ts = game:GetService("TweenService")
local ti = TweenInfo.new(1, Enum.EasingStyle.Linear, Enum.EasingDirection.Out)
local offset = {Offset = Vector2.new(1, 0)}
local create = ts:Create(gradient, ti, offset)
local startingPos = Vector2.new(-1, 0)
local list = {} 
local s, kpt = ColorSequence.new, ColorSequenceKeypoint.new
local counter = 0
local status = "down" 
gradient.Offset = startingPos
local function rainbowColors()
	local sat, val = 255, 255 
	for i = 1, 15 do 
		local hue = i * 17 
		table.insert(list, Color3.fromHSV(hue / 255, sat / 255, val / 255))
	end
end
rainbowColors()
gradient.Color = s({
	kpt(0, list[#list]),
	kpt(0.5, list[#list - 1]),
	kpt(1, list[#list - 2])
})
counter = #list
local function animate()
	create:Play()
	create.Completed:Wait() 
	gradient.Offset = startingPos 
	gradient.Rotation = 180
	if counter == #list - 1 and status == "down" then
		gradient.Color = s({
			kpt(0, gradient.Color.Keypoints[1].Value),
			kpt(0.5, list[#list]), 
			kpt(1, list[1]) 
		})
		counter = 1
		status = "up" 
	elseif counter == #list and status == "down" then 
		gradient.Color = s({
			kpt(0, gradient.Color.Keypoints[1].Value),
			kpt(0.5, list[1]),
			kpt(1, list[2])
		})
		counter = 2
		status = "up"
	elseif counter <= #list - 2 and status == "down" then 
		gradient.Color = s({
			kpt(0, gradient.Color.Keypoints[1].Value),
			kpt(0.5, list[counter + 1]), 
			kpt(1, list[counter + 2])
		})
		counter = counter + 2
		status = "up"
	end
	create:Play()
	create.Completed:Wait()
	gradient.Offset = startingPos
	gradient.Rotation = 0 
	if counter == #list - 1 and status == "up" then
		gradient.Color = s({ 

			kpt(0, list[1]), 
			kpt(0.5, list[#list]), 
			kpt(1, gradient.Color.Keypoints[3].Value)
		})
		counter = 1
		status = "down"
	elseif counter == #list and status == "up" then
		gradient.Color = s({
			kpt(0, list[2]),
			kpt(0.5, list[1]), 
			kpt(1, gradient.Color.Keypoints[3].Value)
		})
		counter = 2
		status = "down"
	elseif counter <= #list - 2 and status == "up" then
		gradient.Color = s({
			kpt(0, list[counter + 2]), 
			kpt(0.5, list[counter + 1]), 
			kpt(1, gradient.Color.Keypoints[3].Value) 	
		})
		counter = counter + 2
		status = "down"
	end
	animate()
end
animate()

Here’s a way of applying a UIGradient’s effect on a textLabel’s text:

I’m guessing the script is working?

Hi, there. I have been through that post, but nothing was really helpful. Any other ideas?

What exactly isn’t working? The script or is the UIGradient not working at all?

The UIGradient, the gradient isn’t working on my custom font. But when I try it on a normal defualt font, it is working like I wanted.

Can’t remember EXACTLY how this works but you need to put the gradient on with all the colours you want, then you must use the offset to make a smooth transition! Hope this helps.

I have found a helpful tutorial on your question: How To Make UIGradient Animations | ROBLOX Studio - YouTube

That is legit where my script is from, lol. But the gradient just don’t seem to be working on my custom font.

Can anyone help me out with this?

Is the color of the font WHITE. Roblox gradients only apply to how white it is. Pure white (255,255,255) is the pure gradient. whilst as pure black (0,0,0) is no gradient at all.

Yes, the font is white. I have noticed that it doesn’t work when it is black. Just like you said.

I actually think it has something to do with the custom font script itself, cuz the tutorial is pretty old. and UI properties are pretty new to the studio. I don’t think he updated the script recently.