---
title: 2D paths
description: The Path2D instance, along with its API methods and properties, lets you implement 2D splines and 2D curved lines.
---
The `Class.Path2D` instance, along with its API methods and properties, lets you implement 2D splines and 2D curved lines, useful for UI effects like path‑based animations and graph editors.
## Create a 2D path
To add a `Class.Path2D` to the screen or an in-experience object:
1. In the [Explorer](../studio/explorer.md) window, insert a `Class.Path2D` instance under a visible `Class.ScreenGui` or `Class.SurfaceGui` (it does not need to be a direct child).
2. Select the new `Class.Path2D` to reveal the in-viewport tooling widget. By default, the **Add Point** tool is selected.
3. Begin clicking on the screen to add a series of **control points** to form a path. The initial path will likely be imprecise but you can [fine‑tune](#move-points) the position of any control point later.
For very specific positioning, select the control point and then, in the [Properties](../studio/properties.md) window, set a new position for the point's `Class.Path2D.SelectedControlPointData|SelectedControlPointData` property (`Datatype.UDim2`).
Note that a point's position is not absolute, but rather **relative** to the path's parent container. For example, compare a control point 30% from left and 20% from top for a path inside a `Class.ScreenGui`, versus an identical path placed inside a `Class.Frame` located in the upper‑right corner of the `Class.ScreenGui`.
### Add points
New control points can be added to a `Class.Path2D` either between two existing points or from either end point using the **Add Point** tool (P).
### Control point tangents
Control point **tangents** let you create and adjust curves on a path.
#### Add tangents
To add tangents to any control point that doesn't already have tangents:
1. Enable the **Add Tangent** tool in the tooling widget.
2. Hover over the desired control point, then click to add two [mirrored](#break-and-mirror) tangents (optionally drag after clicking to [adjust](#adjust-tangents) the new tangents).
#### Adjust tangents
To adjust existing tangents for an individual control point:
1. Enable the **Select** tool (V).
2. Hover over a tangent marker (not the control point), then click‑and‑drag it to a new position. If the tangents are mirrored, the paired tangent point will move in unison.
To manually set a specific `Datatype.UDim2` position for a tangent:
1. Enable the **Select** tool (V) and select the control point.
In the [Properties](../studio/properties.md) window, expand the `Class.Path2D.SelectedControlPointData|SelectedControlPointData` field to expose the `Datatype.Path2DControlPoint.LeftTangent|LeftTangent` and `Datatype.Path2DControlPoint.RightTangent|RightTangent` properties.
2. Set the position for `Datatype.Path2DControlPoint.LeftTangent|LeftTangent` and/or `Datatype.Path2DControlPoint.RightTangent|RightTangent`. Note that this will [break the mirrored behavior](#break-and-mirror) of the tangents.
#### Delete tangents
To delete both tangents from a control point, hover over and right-click that point, then select **Clear Tangents** from the contextual popup menu.
To delete just one of the tangents (left or right), hover over and right‑click that tangent's marker, then select **Delete Tangent**.
#### Break and mirror
By default, tangents mirror each other. When you [drag to adjust](#adjust-tangents) one tangent marker, the paired tangent point will move in unison.
To "break" the tangents so that each can be moved independently of the other, hover over and right‑click the associated control point, then select **Break Tangents** from the contextual menu. Once broken, you can move each tangent marker without affecting the other.
| Property | Description |
|---|---|
| `Class.Path2D.Color3|Color3` | Sets the color of the path line. |
| `Class.Path2D.Thickness|Thickness` | Sets the thickness of the path line, in pixels. |
| `Class.Path2D.Visible|Visible` | Make the path visible or not in both edit and runtime. |
| `Class.Path2D.ZIndex|ZIndex` | Order in which a path renders relative to other GUIs. |