PathFollow3D
Code-driven position and orientation along a parent Path3D Curve.
Make PathFollow3D a direct child of Path3D with a usable Curve3D and put the moving object under the follower. Assign Progress or ProgressRatio after tree entry. Motion is not automatic: for local speed, advance Progress += speed * (float)delta in your chosen processing loop. This follows transforms; handle physical collisions separately.
Progress is distance; ratio is its fraction of current baked length. Loop wraps distance without joining open geometry. Parent scale changes world speed. Progress assigned before tree entry may not normalize on entry, and reassigning identical 3D Progress does not refresh the transform.
RotationMode=None resets rotation on update; other modes correct the path frame. UseModelFront switches +Z/−Z and the HOffset axis. Tilt applies after axis correction and can add roll even with Y mode. Offset and scale are separate operations. Without a Curve the old transform can remain while ratio becomes 0; this is not arrival at the start.
Small nondegenerate paths and direct transform changes were tested in Windows headless. Physics movement, animation timing, vertical/degenerate orientation cases, gizmos and graphics were not accepted.
Declarations checked against C# SDK 1.0.0. Expand a name to see declarations and documentation.
Constructors1
PathFollow3DConstructor
public PathFollow3D();Creates an Entity3D follower with Loop/CubicInterp/TiltEnabled=true, RotationMode=Xyz and UseModelFront=false. Requires a direct in-tree Path3D parent with a usable Curve3D. Advance Progress yourself; this changes transforms without physical collision solving.
Properties9
CubicInterpProperty
public bool CubicInterp { get; set; }Cubic interpolation of the baked cache, true by default. Neither exact Bezier sampling nor a physics setting; sparse-cache positions can differ from linear distance sampling. Setter changes the flag without immediately recalculating transform. Configure before changing Progress; in 3D reassigning identical Progress also does not refresh transform.
HOffsetProperty
public float HOffset { get; set; }Offset along final path-frame local X after RotationMode/UseModelFront/tilt. UseModelFront flips X and therefore this offset direction. Applied before restoring the follower own Scale; Path3D scale still affects world position.
LoopProperty
public bool Loop { get; set; }On Progress assignment, wraps distance by path length; false clamps to 0..length. A nonzero length multiple is retained at the endpoint rather than necessarily zero. Joins neither endpoints nor tangents of open geometry and starts no motion. Toggling the flag does not normalize an already stored distance.
ProgressProperty
public float Progress { get; set; }Local-unit distance along the parent Path baked curve, not seconds. Advance Progress by speed×delta yourself; no automatic motion occurs. With an active path the setter applies Loop/clamp. A value assigned before tree entry can remain out of range: initialize after attaching Path/Curve. Parent scale changes world speed.
ProgressRatioProperty
public float ProgressRatio { get; set; }Fraction of current baked length: setter passes ratio×length to Progress. Requires a direct Path parent inside the tree, a Curve and nonzero length. Values outside 0..1 follow Loop/clamp rather than separate clamping. Getter returns 0 without a usable path, not proof of arrival at the start. A length change preserves distance rather than the old ratio.
RotationModeProperty
public PathFollow3D.RotationModeEnum RotationMode { get; set; }Corrects the basis: None resets rotation on update, Y retains only Euler Y, Xy removes Z roll, Xyz retains all axes; calculations use YXZ order. Oriented rebuilds from the tangent with Y-up rather than retaining input roll. TiltEnabled applies AFTER correction and can restore tilt with Y/Xy. For Oriented heed the Curve.UpVectorEnabled warning; degenerate/vertical cases were not accepted here.
TiltEnabledProperty
public bool TiltEnabled { get; set; }Applies Curve3D tilt radians after RotationMode and UseModelFront. Thus Y-only does not guarantee no roll when tilt is enabled. Skipped for RotationMode=None. Does not create curve tilt data.
UseModelFrontProperty
public bool UseModelFront { get; set; }With orientation enabled, uses model +Z rather than −Z front by flipping basis X/Z. Also changes HOffset direction. Changes neither Curve geometry nor length and has no effect with RotationMode=None.
VOffsetProperty
public float VOffset { get; set; }Offset along final path-frame local Y, not necessarily world-up. Curve tilt rotates it too; supply finite local-unit values.
Methods19
CorrectPostureTransform3D
public static Transform3D CorrectPosture(Transform3D transform, PathFollow3D.RotationModeEnum rotationMode);Statically corrects an input Transform3D Basis by RotationMode while preserving Origin. None sets identity Basis; Y/Xy/Xyz rebuild from normalized YXZ Euler; Oriented builds tangent Y-up from −Basis.Z. Samples no curve and applies neither UseModelFront nor tilt; arbitrary input Basis scale is not a promised preserved contract. Returns a value without editing an Entity.
| Name | Type | Default |
|---|---|---|
transform | Transform3D | — |
rotationMode | PathFollow3D.RotationModeEnum | — |
transformTransform3D with a usable direction/basis; use the returned result explicitly.
rotationModeNone, Y, Xy, Xyz or Oriented; see the description for axes and tilt.
Transform3DNew Transform3D retaining Origin with a corrected Basis.
GetCubicInterpolationbool
public bool GetCubicInterpolation();Reads CubicInterp. Cubic interpolation of the baked cache, true by default. Neither exact Bezier sampling nor a physics setting; sparse-cache positions can differ from linear distance sampling. Setter changes the flag without immediately recalculating transform. Configure before changing Progress; in 3D reassigning identical Progress also does not refresh transform.
boolStored method setting, not a movement/readiness signal.
GetHOffsetfloat
public float GetHOffset();Reads HOffset. Offset along final path-frame local X after RotationMode/UseModelFront/tilt. UseModelFront flips X and therefore this offset direction. Applied before restoring the follower own Scale; Path3D scale still affects world position.
floatStored method setting, not a movement/readiness signal.
GetProgressfloat
public float GetProgress();Reads Progress. Local-unit distance along the parent Path baked curve, not seconds. Advance Progress by speed×delta yourself; no automatic motion occurs. With an active path the setter applies Loop/clamp. A value assigned before tree entry can remain out of range: initialize after attaching Path/Curve. Parent scale changes world speed.
floatStored local distance, not seconds or percent.
GetProgressRatiofloat
public float GetProgressRatio();Reads ProgressRatio. Fraction of current baked length: setter passes ratio×length to Progress. Requires a direct Path parent inside the tree, a Curve and nonzero length. Values outside 0..1 follow Loop/clamp rather than separate clamping. Getter returns 0 without a usable path, not proof of arrival at the start. A length change preserves distance rather than the old ratio.
floatProgress / current length, or 0 without a usable path; not an arrival event.
GetRotationModePathFollow3D.RotationModeEnum
public PathFollow3D.RotationModeEnum GetRotationMode();Reads RotationMode. Corrects the basis: None resets rotation on update, Y retains only Euler Y, Xy removes Z roll, Xyz retains all axes; calculations use YXZ order. Oriented rebuilds from the tangent with Y-up rather than retaining input roll. TiltEnabled applies AFTER correction and can restore tilt with Y/Xy. For Oriented heed the Curve.UpVectorEnabled warning; degenerate/vertical cases were not accepted here.
PathFollow3D.RotationModeEnumStored method setting, not a movement/readiness signal.
GetVOffsetfloat
public float GetVOffset();Reads VOffset. Offset along final path-frame local Y, not necessarily world-up. Curve tilt rotates it too; supply finite local-unit values.
floatStored method setting, not a movement/readiness signal.
HasLoopbool
public bool HasLoop();Reads Loop. On Progress assignment, wraps distance by path length; false clamps to 0..length. A nonzero length multiple is retained at the endpoint rather than necessarily zero. Joins neither endpoints nor tangents of open geometry and starts no motion. Toggling the flag does not normalize an already stored distance.
boolStored method setting, not a movement/readiness signal.
IsTiltEnabledbool
public bool IsTiltEnabled();Reads TiltEnabled. Applies Curve3D tilt radians after RotationMode and UseModelFront. Thus Y-only does not guarantee no roll when tilt is enabled. Skipped for RotationMode=None. Does not create curve tilt data.
boolStored method setting, not a movement/readiness signal.
IsUsingModelFrontbool
public bool IsUsingModelFront();Reads UseModelFront. With orientation enabled, uses model +Z rather than −Z front by flipping basis X/Z. Also changes HOffset direction. Changes neither Curve geometry nor length and has no effect with RotationMode=None.
boolStored method setting, not a movement/readiness signal.
SetCubicInterpolationvoid
public void SetCubicInterpolation(bool enabled);Sets CubicInterp. Cubic interpolation of the baked cache, true by default. Neither exact Bezier sampling nor a physics setting; sparse-cache positions can differ from linear distance sampling. Setter changes the flag without immediately recalculating transform. Configure before changing Progress; in 3D reassigning identical Progress also does not refresh transform.
| Name | Type | Default |
|---|---|---|
enabled | bool | — |
enabledNew flag value; see the method description for scope and update timing.
SetHOffsetvoid
public void SetHOffset(float hOffset);Sets HOffset. Offset along final path-frame local X after RotationMode/UseModelFront/tilt. UseModelFront flips X and therefore this offset direction. Applied before restoring the follower own Scale; Path3D scale still affects world position.
| Name | Type | Default |
|---|---|---|
hOffset | float | — |
hOffsetFinite offset in the local frame determined by orientation mode.
SetLoopvoid
public void SetLoop(bool loop);Sets Loop. On Progress assignment, wraps distance by path length; false clamps to 0..length. A nonzero length multiple is retained at the endpoint rather than necessarily zero. Joins neither endpoints nor tangents of open geometry and starts no motion. Toggling the flag does not normalize an already stored distance.
| Name | Type | Default |
|---|---|---|
loop | bool | — |
loopEnables wrapping on subsequent Progress assignments; does not close geometry.
SetProgressvoid
public void SetProgress(float progress);Sets finite local distance and updates the transform with an active Path3D. In 1.0.0 an identical stored value returns BEFORE normalization: reassigning it neither fixes out-of-tree Progress nor forces a transform refresh. Initialize after path readiness and validate bounds.
| Name | Type | Default |
|---|---|---|
progress | float | — |
progressFinite local distance, not time; Loop/clamp require a usable parent path.
SetProgressRatiovoid
public void SetProgressRatio(float ratio);Sets ProgressRatio. Fraction of current baked length: setter passes ratio×length to Progress. Requires a direct Path parent inside the tree, a Curve and nonzero length. Values outside 0..1 follow Loop/clamp rather than separate clamping. Getter returns 0 without a usable path, not proof of arrival at the start. A length change preserves distance rather than the old ratio.
| Name | Type | Default |
|---|---|---|
ratio | float | — |
ratioFinite baked-length fraction; values outside 0..1 follow Loop.
SetRotationModevoid
public void SetRotationMode(PathFollow3D.RotationModeEnum rotationMode);Sets RotationMode. Corrects the basis: None resets rotation on update, Y retains only Euler Y, Xy removes Z roll, Xyz retains all axes; calculations use YXZ order. Oriented rebuilds from the tangent with Y-up rather than retaining input roll. TiltEnabled applies AFTER correction and can restore tilt with Y/Xy. For Oriented heed the Curve.UpVectorEnabled warning; degenerate/vertical cases were not accepted here.
| Name | Type | Default |
|---|---|---|
rotationMode | PathFollow3D.RotationModeEnum | — |
rotationModeNone, Y, Xy, Xyz or Oriented; see the description for axes and tilt.
SetTiltEnabledvoid
public void SetTiltEnabled(bool enabled);Sets TiltEnabled. Applies Curve3D tilt radians after RotationMode and UseModelFront. Thus Y-only does not guarantee no roll when tilt is enabled. Skipped for RotationMode=None. Does not create curve tilt data.
| Name | Type | Default |
|---|---|---|
enabled | bool | — |
enabledNew flag value; see the method description for scope and update timing.
SetUseModelFrontvoid
public void SetUseModelFront(bool enabled);Sets UseModelFront. With orientation enabled, uses model +Z rather than −Z front by flipping basis X/Z. Also changes HOffset direction. Changes neither Curve geometry nor length and has no effect with RotationMode=None.
| Name | Type | Default |
|---|---|---|
enabled | bool | — |
enabledNew flag value; see the method description for scope and update timing.
SetVOffsetvoid
public void SetVOffset(float vOffset);Sets VOffset. Offset along final path-frame local Y, not necessarily world-up. Curve tilt rotates it too; supply finite local-unit values.
| Name | Type | Default |
|---|---|---|
vOffset | float | — |
vOffsetFinite offset in the local frame determined by orientation mode.
PathFollow3D.RotationModeEnum
| Value | Description |
|---|---|
None = 0 | On PathFollow3D updates, resets rotation to identity while preserving own scale separately. Does not retain manual rotation like 2D Rotates=false. UseModelFront and tilt are skipped in this branch. |
Oriented = 4 | The current CorrectPosture rebuilds from tangent −Basis.Z with Y-up through looking_at rather than retaining the whole input roll/up frame. Keep Curve.UpVectorEnabled as required by the editor warning; this does not promise preservation of all cached up vectors after correction. UseModelFront and tilt may follow. Vertical/degenerate cases were not accepted here. |
Xy = 2 | During YXZ Euler correction, retains X/Y and zeros Z. Curve tilt is added afterward with TiltEnabled, so the final result need not remain roll-free. |
Xyz = 3 | Uses all corrected path-frame axes; the PathFollow3D default. Does not preserve arbitrary manual object orientation: the basis comes from Curve, followed by UseModelFront and tilt. |
Y = 1 | Retains Euler Y during YXZ basis correction. TiltEnabled applies later and can add roll; disable tilt if unwanted. A local path-frame rule rather than a physics rotation constraint. |