Studio Yotsuba
Back to Node List

Path Tangent

path_tangent

Get the tangent direction at a position on a bezier path

Reviewed
Guide available

Input Ports

NameTypeDescription
Path
path
Path
Required
Bezier path to sample tangent from

Output Ports

NameTypeDescription
Direction
direction
Vec2
Normalized tangent direction vector
Angle
angle
Float
Tangent angle in degrees (0-360)

Parameters

NameTypeDefaultRangeDescription / Options
Sub-path
sub_path_index
Int
00–255

Index of the sub-path to sample tangent from (0 = first)

Position
t
Float
00–1 / step 0.01

Position on the path (0 = start, 1 = end)

Overview

Extracts the direction of travel (the tangent direction) at a position t on a path. Pair it with path_sample (position) to create natural trajectory animation—arrows, fish, cars, and other objects that face the direction they move.

Usage tips

  • The go-to pair sends the same t to both path_sample (→ translation) and Path Tangent (→ transform rotation). The trick is to use one source to drive t.
  • angle is in degrees (0–360) and connects directly to transform rotation.
  • If the object moves backward, place path_reverse upstream or add 180 to angle.

Related nodes

  • path_sample — position counterpart (almost always used together)

  • transform — apply the rotation

  • path_reverse — reverse the direction of travel

  • math_op — adjust the angle offset

  • Version: 1

Behavior

  1. Gets the tangent vector at t with sample_path_tangent().
  2. Normalizes the vector (converts it to length 1).
  3. Calculates the angle with atan2 and wraps it to 0–360°.
  4. With no path connected, returns direction=(1,0), angle=0°.

Examples

Rotation animation along a path

[Bezier Path] → path → [Path Tangent] → angle → [Transform(rotation)] → [Preview]
                            ↑ t                           ↑
                    [Time Source → Remap]            [Path Sample → x,y]

Promote t to an input pin 📌, connect the Time Source → Remap output, and combine it with Path Sample to animate movement along the path while rotating to face the direction of travel. The sub_path_index slider limit follows the current input. A saved value that is temporarily out of range is preserved with a warning and becomes active again when the subpath count returns.

Back to Node List