Predict alpha value TweenService

Hello, I am just wondering if there is a way to predict the alpha value. So you know how there is a variable (that we’ll call) t? This variable ranges from 0-1. I already know about the existence of TweenService:GetValue() but is there something like TweenService:GetAlpha or so? For instance, let’s say I have a part that is being tweened from 0,0,0 to 10,10,10. 5,5,5 will be 0.5 in a linear easing style.

What I want to do is get the alpha value using the value. Another example is 0-20, 15 will be 0.75. So is there a way I can get t using the value?

I am picturing something like this:

local alpha = :GetAlpha(c,a,b,Enum.EasingStyle.Sine,Enum.EasingDirection.InOut)
--[[
a = the first value
b = the second value
c = the value to use

Result: A value ranging from  0-1 that indicates where in the tweening the given value is present.
]]
2 Likes

nope, tweens don’t have public properties you can use to get the progress %
https://developer.roblox.com/en-us/api-reference/class/Tween

1 Like

I don’t want to check the in-game process, I just want a way to calculate where in the tween the given value is. I’d figure that since there is GetValue then there might be a function to get the alpha based on the value, but I guess I am wrong.

I believe there is a way to approximate it using GetValue and then slowly but surely approximate it but I rather calculate it directly with precision than do these tedious processes.

For instance, imagine a calculator’s graph. It allows you to find where in the graph the x value you give is, you can find by x or find by y. This is essentially the same and what I want to accomplish if you imagine x is t and y is the real value.

I haven’t seen a function like that in roblox

the docs don’t show any other references of Easing style besides UIPageLayout too, so I doubt they have a function that gives us things like the coefficients and exponents in each of the easing styles either
https://developer.roblox.com/en-us/api-reference/enum/EasingStyle#referenced-by-

1 Like

I found this post which has all the functions. However, I myself do not know how to translate them to roblox, but I believe that doing so will allow me to predict what t would be with the given value.

the format they’re written as is weird, but you can read the cubic function, x^3 {0 <= x <= 1}, as y = x^3; (where x starts at 0 and ends at 1)

then reorder the equation to solve for x to get x=cubedRoot(y)

then, to use it in roblox, solve for x and divide it by whatever y would be if x is 1

1 Like

I’ll try that thanks, wish me luck!