How do I read a NumberSequence value?

Hello!

I am currently having a problem reading this NumberSequence. I want to replicate it in a script inside of ReplicatedFirst but I don’t know how to read it, it just looks like a bunch of random numbers to me.

Here’s the output:
0 0.729412 0.595239 0.560739 0 0.463333 0.601331 0.515463 0.494004 0 0.561667 1 0.902861 0.880003 0 1 1 1 1 0

TIA for any help! :smile:

A number sequence is essentially an xy graph that has time as x and y as the second number. It must always start at zero. An example of this is the first part of your output 0 0.729412. This says at time 0 go to point 0.729412. As you can see at the end (when x = 1) it goes back to zero so it can be looped. You can see a graph of this here: Graphing Calculator. As for converting it back you would need to make a series of number sequence keypoints like so:

NumberSequence.new{
    NumberSequenceKeypoint.new(0, 0.729412),
    NumberSequenceKeypoint.new(0.595239, 0.560739,
    NumberSequenceKeypoint.new(0, 0.463333),
--etc
}

Hope this helps! :smile:

1 Like