How to find a specific number within a point of a graph using easing styles

Hello! today I’m trying to find a number from a specific point in a graph. Some background info: I have a module with specific data ex: 20 xp for win and currently my script does xp / maxwave * wave but I’m trying to instead of making the data linear make it on a easing style. The easing style I’m going for is quart ex:
image

How would I do this?

2 Likes

I’m not 100% on this,

Could you not tween a NumberValue or IntValue and use that to help you get the value specific to a graph point? As the number would be moving in a Quart easingstyle.

Just a thought.

2 Likes

Yeah thats what I’m thinking but my question is how would I find that point within the graph?
for instance the maxwave is 42 and the wave is 21 how would I find the middle of the graph?

Hey, really cool function here: TweenService:GetValue

1 Like

The arguments are - the alpha (percentage completed, gets converted to the easing style’s value at that X point), easing style, and easing direction

1 Like

Ik this explains how to use it but could you provide an ex for how to use it in a script

Yeah, sure!
I used this script for creating a smooth camera tween

local val = TS:GetValue(percentage, Enum.EasingStyle.Cubic, Enum.EasingDirection.Out) --lerp animation

local cameraLerp: CFrame = camera.CFrame:Lerp(goalCamera, val)
1 Like

Thank you I appreciate it :heart:

Hey again im a bit confused when i get the val it returns 1

what is your percentage value?

85 imputed does it need to be in some special percentage way my code

local percentage = math.floor(game.ReplicatedStorage.Wave.Value / game.ReplicatedStorage.MaxWave.Value*100)

aha! I believe your percentage value needs to be a decimal. So, just divide it by 100.