How to slowly make trails go invinsible

Heloo, im trying to make a trail slowly go invis. the problem is it doesn’t work
I tried this

while true do
wait()
trail.Transparency = trail.Transparency + NumberSequence.new(0.5)
end

And I got the error Attempt to perform arithmetic (add) on numbersequence
Please help

1 Like
trail.Transparency = NumberSequence.new(0,1)

The reason the trail’s transparency is a numbersequence and not a float is because its designed to allow you to add a gradient. If you don’t understand how this works I suggest you to review the API :slight_smile:

1 Like

NumberSequence requires more than one integer.

while task.wait() do
    trail.Transparency = trail.Transparency + .5
end

If you want the trail to be less and less visible at its end, then you can just double click transparency and you should see three dots, click on it, and you can edit the trails transparency levels throughout its lifetime.

OR, if you want to do it in a script, use NumberSequenceKeypoint.new(timestamp, value) and put it in a table, here’s an example.

particleEmitter.Transparency = NumberSequence.new{
    NumberSequenceKeypoint.new(0, 0), -- (time, value)
    NumberSequenceKeypoint.new(.5, .75),
    NumberSequenceKeypoint.new(1, 1)
}

For further information, please check the documentation.

2 Likes

I got the same error message does anyone know how to do this correctly?