Create a new spline:
local Points = {}
local Spline = SimpleSpline.new(Points,Alpha,Tension)
Set Options
Spline:SetOptions({
Uniform = true,
Offset = CFrame.new(),
Loop = true,
Reverse = false
})
Visualize the spline:
Spline:Visualize()
Destroy the Visualization:
Spline:ClearVisualize()
Moving a object along the spline:
local Path = Spline:FollowPath(Obj,Speed)
SimpleSpline.new(Points,Alpha,Tension)
Description: Creates a new Spline Object
Param: Points - table of CFrames
Param: Alpha - number from 0 - 1
Param: Tension - number from 0 - 1
Returns: Spline
Spline:GetSpeedFromTime(Time)
Description: Gets the speed from a given time
Param: Time
Returns: Speed
Spline:UpdatePoints(Points)
Description: Updates the points of the spline
Param: Points - table of CFrames
Spline:SetOptions({
Uniform : boolean,
Offset : CFrame,
Loop : boolean,
Reverse : boolean
})
Description: Sets the options of the spline
Param: Options - a table of options
Spline:FollowPath(Objects,Speed,Distance)
Description: Moves a object or a list of objects along the spline with a given speed
Param: Objects - BasePart or Model or table of BaseParts or Models
Param: Speed - number
Param: Distance - number
Returns: Path
{
Completed : RBXScriptSignal,
PathCompleted : RBXScriptSignal,
Time : number,
NodeReached : RBXScriptSignal,
Stop : Function
ChangeSpeed : Function,
GetElapsed : Function,
}
Description: A object that is returned by Spline:FollowPath
Path.Stop()
Description: Stops the path
Path.ChangeSpeed(Speed)
Description: Changes the speed of the path
Path.GetElapsed()
Description: Gets the elapsed time of the path
Path.Completed
Description: A signal that fires when a object finishes the path
Path.PathCompleted
Description: A signal that fires when the entire path is completed