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:
number
Gets and sets the current position of the AccelTween
v
AccelTween.v:
number
Gets and sets the current velocity of the AccelTween
a
AccelTween.a:
number
Gets and sets the maximum acceleration.
t
AccelTween.t:
number
Gets and sets the target position.
rtime
This item is read only and cannot be modified. Read OnlyAccelTween.rtime:
number
Returns the remaining time before the AccelTween attains the target.
pt
AccelTween.pt:
number
Sets 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
) →
AccelTween
Constructs 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)