shortes path
This node routes input particles through a network of path nodes toward one or more target particles using the shortest path algorithm with a Euclidean heuristic. Each input particle finds its nearest entry point into the path graph, computes the optimal route to the nearest target, and travels along that route at a controllable speed. The path graph is automatically rebuilt whenever path or target particles change position, appear, or disappear. Paths are visualized in the viewport as lines for easy debugging.
[Inputs]
#Particle Stream - Requires a particle stream to be connected. Each particle in the stream will be independently routed through the Path Group network toward its nearest Target Group particle. Particles travel along their computed path at the speed defined by the Travel Speed parameter, advancing each simulation frame by dt ?? speed world units..
Enabled - Enable or disable node evaluation.
Waypoints Group - The particle group whose particles define the path network. Each particle in this group becomes a node in the path graph. Edges are automatically created between nodes within the Connect Radius distance. The graph is rebuilt whenever this group changes. Path group particles should be separate from the travelling particles ??? using the same group will cause incorrect behavior.
Target Mode - Choose between particle group or custom position.
Target Group - The particle group containing destination particles. Each travelling particle will find its nearest target and compute a shortest path toward it. If multiple target particles exist, each travelling particle independently routes to its closest one. When a travelling particle reaches its target the Arrived output pin is set to true. Visible only when Target Mode is set to Particle Group.
Target Position - Defines the destination as a world-space position instead of a particle. When connected to an upstream output pin, each particle can receive a different target position, giving precise per-particle control over where each one is heading. The nearest path graph node to this position is used as the path endpoint, with the final segment bridging directly to the exact target position. Visible only when Target Mode is set to Position.
Target Selection - Target selection within the Target Group:
- Closest - route source particle to its nearest target.
- Random - route source particle to a random target."
Properties
Invert Path - Reverses the direction in which particles travel along the computed path. When disabled (the default), each particle moves from its starting waypoint to the chosen target. When enabled, the same path is walked in the opposite order, so particles move from the target back toward the start.
Move To Path - Controls whether each input particle is teleported onto the path the first time the path is created for that particle. When enabled, the particle is placed at a specific point along the path (see Relative Position %) and its velocity is zeroed; from that frame on it travels along the route at the configured Travel Speed. When disabled, the particle keeps its original position and the node only outputs Position / Path % values to be sampled or displayed ??? the particle itself is not moved or constrained to the path.
Relative Position % - When Move To Path is enabled, this controls where along the path the particle is placed on the snap frame, expressed as a percentage of total path length. 0 places the particle at the path start (the original snap-to-front behaviour); 100 places it at the path end; 50 places it at the midpoint, and so on. The value is clamped to [0, 100]. The internal mapping is fraction ?? total path length, with linear interpolation between the two surrounding waypoints ??? so the particle lands exactly on the path geometry regardless of how the waypoints are spaced. A non-zero value is useful when several particles share the same route but should appear to be at different stages of travel, or when a path should be entered partway through (for example, joining a stream that is already in progress).
Relative Position Var % - Adds per-particle random variation to Relative Position %, so multiple particles assigned to the same path are spread out along it instead of stacking on a single point. The value is a percentage in [0, 100] and is interpreted as a fraction of Relative Position % itself.
Travel Speed - Controls how fast each particle travels along its computed path, measured in world units per second of simulation time. Each frame the particle advances by dt*Travel Speed along its path. Higher values cause particles to reach their destination faster. This parameter is animatable, allowing speed changes over time, but note that changing speed does not trigger a path recompute - only the rate of travel changes.
Travel Speed Var % - How tightly each particle follows the path each frame. Lower values smooth out abrupt direction changes when the path is rebuilt or rerouted, at the cost of a small lag behind the path.
Velocity Blend % - How tightly each particle follows the path each frame. Lower values smooth out abrupt direction changes when the path is rebuilt or rerouted, at the cost of a small lag behind the path.
Connect Radius -. Maximum distance between two Path Group particles for them to be considered directly connected by an edge in the path graph. Increase this value if your path nodes are sparsely placed and particles cannot find a complete route to the target. Decrease it to prevent long-range shortcuts that cause particles to skip over nearby nodes. As a rule of thumb, set this to slightly larger than the average spacing between your path nodes. If no path can be found between start and target, the particle will not move - check this value first."
Max Neighbours - Limits the maximum number of edges each path graph node can have. This prevents highly connected hub nodes from creating long-range shortcuts even when Connect Radius is large. A value of 4 to 6 is sufficient for most path networks.
Smooth Path - When enabled, fits a Catmull-Rom spline through the waypoints before travel begins, replacing the sharp angular corners of the raw graph path with smooth curves. The spline passes exactly through every original waypoint so the path still respects the graph topology ??? only the segments between waypoints are curved. Smoothing is applied once at path build time and stored, so there is no per-frame cost. Has no effect on paths with fewer than three waypoints.
Smooth Samples - Number of interpolated points inserted between each pair of waypoints when Smooth Path is enabled. Higher values produce smoother, more finely subdivided curves at the cost of a larger waypoint array and slightly more memory per particle path. Values between 4 and 8 are sufficient for most path networks. Very high values only produce visible improvement when waypoints are far apart or the corner angle is very sharp. Visible only when Smooth Path is enabled.
Path Penalty
Use Turn Penalty -. Master toggle for the turn-angle penalty in the pathfinding cost. When disabled, algorithm searches purely for the geometrically shortest route through the waypoint graph, regardless of how sharp the corners are. When enabled, each segment carries an additional cost proportional to how much the path turns at the connecting waypoint, so the search prefers smoother routes. Turning this off also hides the Turn Weight slider and the Angle Penalty curve from the interface, since they have no effect.
Turn Weight -. Overall strength of the turn-angle penalty. Multiplied into the per-edge cost added by Use Turn Penalty, so larger values bias the search more strongly toward routes with gentler curves..
Turn Weigh Ramp - Curve that maps turn angle (X axis, in degrees from 0 to 180) to a relative penalty multiplier (Y axis, from 0 to 1). This is what gives Turn Weight its shape - Turn Weight sets the overall strength, the ramp controls which angles are punished and how harshly relative to one another. 0 means the path continues in a straight line through a waypoint; 90 means a right-angle turn; 180 means a complete reversal. A flat ramp at Y = 1 penalizes every turn equally, including very gentle ones. A ramp that stays at 0 for small angles and then rises sharply only punishes hard corners and lets the search take broad sweeping turns for free. Ramps that peak in the middle and fall off again can be used to make U-turns (180) cheap relative to right angles. The Y range is fixed to 0..1 by design ??? absolute penalty strength belongs to Turn Weight. The ramp shapes the relationship between angles, while Turn Weight and the segment length determine how much that shape actually costs the search.
Use Custom Penalty - Master toggle for a per-waypoint extra cost sourced from a custom particle channel on the Waypoints Group. When enabled, every waypoint can carry its own scalar cost (read from the named channel) which is added to the search cost whenever a route traverses an edge ending at that waypoint. When disabled, all waypoints are treated as equally cheap and only geometric distance (and optionally turn penalty) drives the search.
Use this to mark waypoints that should be avoided - high-traffic zones, hazards, expensive terrain - without removing them from the graph. Negative channel values are clamped to zero to keep the search numerically stable, and the per-waypoint cost is refreshed automatically whenever the channel selection or the channel values change, so the routes update in response to per-frame edits.
Penalty Channel - Name of the custom channel on the Waypoints Group that carries the per-waypoint penalty value used by Use Custom Penalty. The channel is read once per waypoint and the value is treated as additional path cost for any edge that terminates at that waypoint. Higher values make the waypoint more expensive and steer the search around it; a value of 0 makes the waypoint behave as it would with the feature disabled.
Display
Show Paths - Toggles viewport display of the computed paths as lines. Each travelling particle's full route from its current position through the path network to its target is drawn. Useful for debugging path graph connectivity and verifying that particles are routing correctly. Does not affect simulation.
Path Color - Color used to draw the path lines in the viewport when Show Paths is enabled.
[Outputs]
Position - Current particle position.
Path % - Percentage of path travelled [0-100].
Arrived - Set to true when particle has arrived to its target.