How to make a MeshPart Texture into a Transparency Gradient using NumberSequence and OffsetStuds

  1. What do you want to achieve?
    Apply a NumberSequence to the Transparency of a Texture in a MeshPart, within OffsetStuds/Keypoints.

  2. What is the issue?
    UIGradients, Beams, and ParticleEmitters have the option of applying a NumberSequence to their Transparency property. The Texture object which is inserted in a MeshPart, does not have the NumberSequence option by default in its Transparency property. How can we apply a NumberSequence to the Transparency of the Texture, as a Gradient effect, via scripting?

  3. What solutions have you tried so far?
    The following is one of our current attempts:

local runService = game:GetService("RunService")

local texture = script.Parent

local function update()
	wait()
	texture.OffsetStudsV = texture.OffsetStudsV + 0.1
	texture.Transparency = NumberSequence.new{
		NumberSequenceKeypoint.new(0, 0), -- (time, value)
		NumberSequenceKeypoint.new(.5, .75),
		NumberSequenceKeypoint.new(1, 1)
	}
	if texture.OffsetStudsV >= 65 then
		texture.OffsetStudsV = 0
	end
end

runService.Heartbeat:Connect(update)

Alternatively, a way to apply a Beam within the shape/form of a MeshPart could also help us achieve what we want. In other words, we need an animated texture with a transparency gradient (fading effect) in a custom surface/model face shape.

1 Like

Yeah, the only way to do this in the way you want would be to make the decal a gif essentially.
Here is the dev forum on how.

1 Like

I appreciate the reply very much, thank you Jay.
What you suggest looks interesting, will look into it and let you know how it goes.

1 Like