Path2DControlPoint

Constructors

NameDescription
new()Returns an empty Path2DControlPoint.
new(Position: UDim2)Returns a Path2DControlPoint with the position set. This constructor sets the left and right tangents to default UDim2 values.
new(Position: UDim2, Left Tangent: UDim2, Right Tangent: UDim2)Returns a Path2DControlPoint with the position, left tangent, and right tangent all set.

Code Snippet

local path = Instance.new("Path2D")
path.Parent = script.Parent

path:SetControlPoints({
    Path2DControlPoint.new(UDim2.fromScale(0, 0)),
    Path2DControlPoint.new(UDim2.fromScale(0.5, 1), UDim2.fromScale(-0.1, 0), UDim2.fromScale(0.1, 0)),
    Path2DControlPoint.new(UDim2.fromScale(1, 0)),
})

Properties

NameTypeDescription
PositionUDim2The position of the Path2DControlPoint relative to the path's container.
LeftTangentUDim2The left tangent of the Path2DControlPoint.
RightTangentUDim2The right tangent of the Path2DControlPoint.