AccelTween
Provides a means to, with both a continuous position and velocity, accelerate from its current position to a target position in minimum time given a maximum acceleration. See Spring for another version of this.
Author: TreyReynolds/AxisAngles
Properties
p
AccelTween.p: numberGets and sets the current position of the AccelTween
v
AccelTween.v: numberGets and sets the current velocity of the AccelTween
a
AccelTween.a: numberGets and sets the maximum acceleration.
t
AccelTween.t: numberGets and sets the target position.
rtime
This item is read only and cannot be modified. Read OnlyAccelTween.rtime: numberReturns the remaining time before the AccelTween attains the target.
pt
AccelTween.pt: numberSets the current and target position, and sets the velocity to 0.
Functions
new
AccelTween.new(maxaccel: number?--
The maximum acceleration applied to reach its target. Defaults to 1
) → AccelTweenConstructs a new AccelTween.
local accelTween = AccelTween.new(30)
accelTween.t = 1
conn = RunService.RenderStepped:Connect(function()
print(accelTween.p)
end)
task.delay(accelTween.rtime, function()
conn:Disconnect()
end)