Use TweenService. It removes the need to interpolate yourself and will fix this problem.
I will assume you know how to set up Services so I will skim over that part.
TweenService works by creating a tween instance that contains all your movement data. It has 3 properties: the object you want to tween (this can be a 3d object, GUI or just any instance with numerical properties), a TweenInfo instance (this contains the information about your tween), and finally the parameters of the object you want to manipulate.
Just a little more about TweenInfo that you should know, it has a number of properties: the durration of the tween (in seconds), the interpolation method (Ex. Linear, Quadratic, Exponential, Back, etc.), the directions it should apply the interpolation (should it interpolate on the start to end, just on the start, etc.) and a couple more that you wont really need to worry about.
With that out of the way lets create a tween. For this I will be tweening the instance Part for one second with the interpolation method set to Circular, interpolating only on the way in, to a new position of 1, 0, 0.
Ex.
local Tween = TweenService:Create(Part, TweenInfo.new(1, Enum.EasingStyle.Circular, Enum.EasingDirection.In), {position = Vector3.new(1, 0, 0)})
Enums are just dictionaries for numbers, Enum.EasingStyle.Circular is actually just the number 8 but it makes it easier to remember when its written like this.
After the tween is set up you need to actually run it. This step is pretty easy.
Ex.
local Tween = TweenService:Create(Part, TweenInfo.new(1, Enum.EasingStyle.Circular, Enum.EasingDirection.In), {position = Vector3.new(1, 0, 0)})
Tween:Play()
Finally here's an example a little closer to your situation.
Ex.
local Tween = TweenService:Create(script.Parent, TweenInfo.new(1, Enum.EasingStyle.Linear, Enum.EasingDirection.In), {TextSize = 90})
Make sure to set the time and interpolation method to whatever you want.
1 comment
Definitely helped! Thank you sm for explaining Tween easily.