Forest Logo
search
package_2

simplespline

By @gitethan1

Roblox

Mirrored

SimpleSpline

How to use

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)

Documentation:

SimpleSpline

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

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

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

Package Details

Install command (Click to copy)


Version

0.1.0

License

MIT

check_circle

Safe for commercial use

infoLicense identified from the packaged LICENSE file; the manifest declared none.

Automated license review — not legal advice.