Class PathFollow3D
- Namespace
- Godot
- Assembly
- GodotSharp.dll
This node takes its parent Path3D, and returns the coordinates of a point within it, given a distance from the first vertex.
It is useful for making other nodes follow a path, without coding the movement pattern. For that, the nodes must be children of this node. The descendant nodes will then move accordingly when setting the Progress in this node.
public class PathFollow3D : Node3D, IDisposable
- Inheritance
-
PathFollow3D
- Implements
- Inherited Members
Constructors
PathFollow3D()
public PathFollow3D()
Properties
CubicInterp
If true
, the position between two cached points is interpolated cubically, and linearly otherwise.
The points along the Curve3D of the Path3D are precomputed before use, for faster calculations. The point at the requested offset is then calculated interpolating between two adjacent cached points. This may present a problem if the curve makes sharp turns, as the cached points may not follow the curve closely enough.
There are two answers to this problem: either increase the number of cached points and increase memory consumption, or make a cubic interpolation between two points at the cost of (slightly) slower calculations.
public bool CubicInterp { get; set; }
Property Value
HOffset
The node's offset along the curve.
public float HOffset { get; set; }
Property Value
Loop
If true
, any offset outside the path's length will wrap around, instead of stopping at the ends. Use it for cyclic paths.
public bool Loop { get; set; }
Property Value
Progress
The distance from the first vertex, measured in 3D units along the path. Changing this value sets this node's position to a point within the path.
public float Progress { get; set; }
Property Value
ProgressRatio
The distance from the first vertex, considering 0.0 as the first vertex and 1.0 as the last. This is just another way of expressing the progress within the path, as the progress supplied is multiplied internally by the path's length.
public float ProgressRatio { get; set; }
Property Value
RotationMode
Allows or forbids rotation on one or more axes, depending on the PathFollow3D.RotationModeEnum constants being used.
public PathFollow3D.RotationModeEnum RotationMode { get; set; }
Property Value
TiltEnabled
If true
, the tilt property of Curve3D takes effect.
public bool TiltEnabled { get; set; }
Property Value
UseModelFront
If true
, the node moves on the travel path with orienting the +Z axis as forward. See also Vector3.FORWARD
and Vector3.MODEL_FRONT
.
public bool UseModelFront { get; set; }
Property Value
VOffset
The node's offset perpendicular to the curve.
public float VOffset { get; set; }
Property Value
Methods
CorrectPosture(Transform3D, RotationModeEnum)
Correct the transform
. rotationMode
implicitly specifies how posture (forward, up and sideway direction) is calculated.
public static Transform3D CorrectPosture(Transform3D transform, PathFollow3D.RotationModeEnum rotationMode)
Parameters
transform
Transform3DrotationMode
PathFollow3D.RotationModeEnum
Returns
HasGodotClassMethod(in godot_string_name)
Check if the type contains a method with the given name. This method is used by Godot to check if a method exists before invoking it. Do not call or override this method.
protected override bool HasGodotClassMethod(in godot_string_name method)
Parameters
method
godot_string_nameName of the method to check for.
Returns
HasGodotClassSignal(in godot_string_name)
Check if the type contains a signal with the given name. This method is used by Godot to check if a signal exists before raising it. Do not call or override this method.
protected override bool HasGodotClassSignal(in godot_string_name signal)
Parameters
signal
godot_string_nameName of the signal to check for.
Returns
InvokeGodotClassMethod(in godot_string_name, NativeVariantPtrArgs, out godot_variant)
Invokes the method with the given name, using the given arguments. This method is used by Godot to invoke methods from the engine side. Do not call or override this method.
protected override bool InvokeGodotClassMethod(in godot_string_name method, NativeVariantPtrArgs args, out godot_variant ret)
Parameters
method
godot_string_nameName of the method to invoke.
args
NativeVariantPtrArgsArguments to use with the invoked method.
ret
godot_variantValue returned by the invoked method.