How to lerp all points in a transparency (number) sequence towards 0

Title pretty much, I want to lerp them from their start point, towards 0.

for particleEmitter, transparency in pairs (originalNumberSequences)do
	local sequenceValues = transparency.Keypoints
	local newValues = {}

	for it, keyPoint in pairs(sequenceValues) do
		newValues[it] = NumberSequenceKeypoint.new(keyPoint.Time, lerp(keyPoint.Value, 0, float))
	end

	particleEmitter.Transparency = NumberSequence.new(newValues)
end

Could you explain your question a bit more? The code you provided seems to be doing that already.

1 Like

yeah sorry I’m quite tired lol. I provided noooo information.

So basically, they aren’t changing at all. They are pointing to the correct objects, the value float does change correctly, but nothing seems to be happening :confused:

You could use tweenservice

TweenService doesn’t work on NumberSequence nor on NumberSequenceKeypoint. Assuming the output of the ‘lerp’ function and the ‘float’ variable are correct in the code in the first post, using TweenService or not instead of lerping should not make a difference.

1 Like

The issue was I was lerping towards 1, and not 0.

Nice!!

3 Likes