Skip to content
omrezkeypie edited this page Aug 1, 2024 · 9 revisions

Constructor

BezierPath.new(Positions : {Vector3},CurveSize : number | {number}) : Path

Takes in a table of positions which will be used as the waypoints for the spline and takes in a number to control the size of the curve between the waypoints and returns the path object.

Optionally you can also input a table of curve sizes where each curve size corresponds to the same position in the positions table. if an index is empty in the curve size table BezierPath will use the default curve size which is 3.

CalculateUniformCFrame

Path:CalculateUniformCFrame(T : number) : CFrame

Takes in a T value from 0-1 and returns a uniform cframe across the path object.

CalculateUniformPosition

Path:CalculateUniformPosition(T : number) : Position

Takes in a T value from 0-1 and returns a uniform position across the path object.

GetPathLength

Path:GetPathLength() : number

Returns the path objects length.

CalculateDerivative

Path:CalculateDerivative(T : number) : Vector3

Takes in a T value from 0-1 and returns the derivative of that T value.

CalculateClosestPoint

Path:CalculateClosestPoint(Position : Vector3) : (CFrame,number)

Takes in a Vector3 position and returns the closest cframe and the closest T value on the path to the inputted position.

VisualizePath

Path:VisualizePath()

Visualizes the path. Used for debug purposes.

Clone this wiki locally