<sk-align-to-spline-constraint>

← prev index next →

Rides a node along a spline path by arc-length progress, optionally turning it to face the direction of travel — the way to move an object along an arbitrary 2D or 3D curve.

Remarks

This is the path-following member of the Constraint family: like every constraint it drives its constrained target — here the target's position, and its orientation when tangential — by recomputing from live scene state each frame, so the target keeps riding the curve even as the curve itself moves or morphs.

Key attributes. progress is arc-length position along the spline: 0 = the start, 1 = the end. A fractional value outside [0, 1] wraps by its fractional part (negative values count back from the end), while whole numbers 1, 2, 3… all rest at the end — so animating it 0 → 1 sweeps the whole path once. spline names the AbstractSpline to follow by #id — any sk-spline, sk-path-spline, or sk-points-spline. tangential turns the target so its +Y axis faces along the direction of travel (the path tangent); leave it off to keep the target's own orientation and only move its position. up-vector disambiguates roll about the tangent when tangential is on and usually needs no override (it defaults to world +Y).

Related. The spline it follows is any member of the AbstractSpline family. Sibling constraints in the Constraint family include sk-orbit-constraint (revolve around a pivot) and sk-target-at-constraint (aim an axis at a node); the GPU-parallel PointConstraint applies path-like displacement to many cloned points.

Serve these docs to run the live example. WebGPU needs a secure context — open this page via grunt serve rather than double-clicking the file. The Markup tab works from disk.

Attributes

AttributeTypeDefaultDescription
splineanimatable <id-ref> The spline to follow, as an AbstractSpline instance or a reference by id
progressanimatable <number> 0.0 Arc-length progress along the spline (0–1). Values wrap cyclically.
tangentialanimatable <boolean> false Whether the target also aligns its +Y axis to the spline tangent.
up-vector <3d-vector> ([<number>, <number>, <number>]) [0, 1, 0] Reference up vector used to orient the target when tangential.