How to increase every point in a number sequence by one

Hello, I have a number sequence for my particle emitter, and when the part its connected to increases I want to increase its size. However, Since the particle emitter is kinda complex:

I can’t just increase the size of it by one number. How can I increase every point in the particle emitter size number sequence by a number?

1 Like

NumberSequence has a Keypoints property which stores an array of NumberSequenceKeypoints which you can use to construct a new NumberSequence with different keypoints

local NewKeypoints = {}

for i, OldKeypoint in ipairs(OldSequence.Keypoints) do
	table.insert(NewKeypoints, NumberSequenceKeypoint.new(OldKeypoint.Time, OldKeypoint.Value + 1))
end

local NewSequence = NumberSequence.new(NewKeypoints)
7 Likes