Attractors

Attractors

Function. Evaluates a field of attractors — zones that pull particles in, push them away and swirl them around — at the given position, and outputs the resulting velocity or force.

An attractor is a sphere, a cylinder or a path placed in the scene. A path is a tube through a chain of keys, with its own radius at every key; its "axis" is the centerline running from the first key to the last. Each attractor has three kinds of influence, and all three can be combined:

  • Pull: Draws particles toward the attractor's core — the center, the axis or the path's centerline (positive) — or pushes them away from it (negative).
  • Swirl: Turns particles around the attractor's axis. The sign sets the direction of rotation.
  • Axial: Carries particles along the attractor's axis — for a path, along it from key to key. The sign sets the direction.

The influence is strongest at the core and fades to nothing at the outer radius; the inner radius marks a dead core where the attractor has no effect at all, so particles are not sucked into a single point. Falloff shapes the fade: Constant keeps full strength up to the outer radius, Linear fades evenly, Smooth eases in and out. Where several attractors overlap, their influences add up.

The block does not move particles by itself: feed its output into a ForceMove block, as a force (particles are pushed, units per second squared) or as a wind (particles are carried, units per second, and need some air resistance to follow it).

Properties & inputs:

  • Position (input): Where the field is sampled — normally the particle's position.
  • Strength (input | property): Multiplies the whole field. 1 applies the attractors as authored, a negative value reverses every pull, swirl and axial. Make it external to drive the field per particle or from an emitter property; the geometry itself stays fixed.
  • Field (property): The attractors. Edit them in the preview viewport — add spheres, cylinders and paths, then move, rotate and scale them with the gizmo.
  • Default falloff / pull / swirl / axial (property): The influence a newly added attractor starts with. Each attractor can then be changed on its own.
  • Show visualizer (property): Draw the field in the preview while the block is not being edited.

Outputs:

  • Value: The field at the sampled position — a velocity for a wind, an acceleration for a force.

From the Emitter Guide

You rarely need to wire the block by hand. In the Emitter Guide, set Movement to Forces, then pick Attractors from Add Force... or Add Wind.... The guide creates the block, feeds it the particle position and connects its output to the movement as a force or as a wind; adding the first wind also fills in a small Air resistance, without which a wind has no effect.

A new entry starts with a single sphere at the center of the world, as large as the project's base unit, with no dead core and a pull toward its center — so the effect is visible at once. Its pull is half the base unit per second for a wind and an eighth of it for a force; the block's Default pull is set to the same value, so the attractors you add next start out alike.

The entry's row has three controls:

  • Strength: Multiplies the whole field. Like any Emitter Guide value it can be random, follow a curve or be combined with other values; anything but a constant drives the block's Strength input.
  • Edit attractors...: Selects the block, which opens its editor in the preview — the same editor described below. The button stays highlighted while the block is being edited.
  • Show visualizer: The block's Show visualizer switch.

On a mirrored emitter the attractors follow the source emitter, so Edit attractors and Show visualizer are disabled there; edit the source instead.

Editing the field

Select the block to edit its attractors in the preview viewport. A toolbar appears on the right of the viewport with one button per attractor type — Sphere, Cylinder and Path. Clicking a button adds that attractor and selects it. In a front, side or top view it appears in the middle of what you see, a third of the view across: a sphere or a cylinder with its axis pointing into the screen, a path as a straight tube of two keys running left to right. In the free camera it appears at the origin, a third of the project's base unit in size, a path along the X axis.

The button to the left of them shows the attractor you are currently editing, and its menu lists every attractor of the field, so you can pick one without clicking it in the viewport. Remove deletes the selected attractor.

With an attractor selected, the gizmo moves, rotates and scales it: scaling along X changes both radii together, along Y the cylinder's length. The small handles let you drag the outer radius, the inner radius and, for a cylinder, its half length directly; the inner radius can never grow past the outer one. Where a handle sits right over the attractor's center, a click there grabs the center and moves the whole attractor, unless the handle is clearly nearer to you. The property panel switches from the block's defaults to the selected attractor's own settings: its position and rotation, pull, swirl, axial, falloff, the radii, the half length and whether it is enabled. Deselect it to get the block defaults back. Each add, remove or edit is a single undo step.

Editing a path

A path has no center of its own: the gizmo sits in the middle of its keys and moves, turns and scales the whole tube — scaling also scales the radii. Every key has two handles: the key itself, which you drag to move it, and its radius handle on the tube's surface, which you drag to make the tube wider or narrower at that key. Between two keys the radius changes evenly, so a path can taper from a wide mouth to a narrow end.

  • Shift+click inserts a key. Hold Shift over the selected path and the preview shows where the key would go: on the centerline of the segment nearest to the mouse (the tube keeps its shape there, the new key takes its radius at that point), or — past either end of an open path — a new segment continuing the path toward the mouse, at the depth of the end key and with the radius the tube has there. Near an existing key a grey marker says no key can go there. Click to insert; keep the button down to drag the new key straight into place. The insert and the drag are one undo step, and Esc during the drag takes the insert back. A closed path has no ends, so it always gets the key in a segment.
  • Double-click the tube to insert a key in the same place, at once (no drag; one undo step).
  • Add key inserts a key halfway after the selected key. With no key selected it adds one at the end: an open path is continued along its last segment, a closed one gets a key halfway along the segment that closes the loop.
  • Delete (or Remove in the toolbar) removes the selected key. A path always keeps at least two keys; remove the attractor itself to get rid of it.
  • Closed joins the last key back to the first, making a loop.

With a path selected the property panel shows Inner ratio instead of the radii: the dead core as a fraction of the tube's radius at each point, so the core widens and narrows with the tube. While a key is selected, Key position and Key radius set that key's position and radius exactly.

Each particle follows the part of the path nearest to it. Where the path bends, or where two parts of it pass close to each other or cross, the neighbouring parts blend over a short distance (half the tube's radius): the flow turns the corner smoothly instead of switching direction at once, and a particle between two crossing parts feels both of them. Where two parts run in opposite directions over each other, their flows cancel out.

Reading the visualizer

The preview draws each attractor as a wireframe of its shape; a path is drawn segment by segment, each one as a tapering tube with a ring at either end, and an open path is rounded off past its ends, because its pull reaches beyond each end as far as the end key's radius (if the first or last keys sit on top of each other, the rounding starts where the path first has length, with that key's radius). Where the path turns, arcs on the outside of the bend join the rings of the two segments: the field reaches round the outside of a bend as far as the radius there (when keys sit on top of each other with different radii, the arcs go from one radius to the other). While you edit the block the wireframes are bright, the dead core shows as a dimmer inner shell, and every attractor also shows which way its field pushes, before the block's Strength: white lines with arrows run over its outer surface along the swirl and the flow, and short arrows between the shells point to the core where the pull draws particles in (green) or away from it where it pushes them out (red). A negative constant Strength turns all the arrows around; a Strength fed from another block or randomized does not change them. The ends of an open path carry pull arrows only — the segment next to each end shows the flow. When you are not editing the block, Show visualizer draws only the outer shells, faintly and without arrows, so they stay out of the way of the effect: watch the particles to see which way they move.

Notes:

  • The attractors are static: they do not move with the emitter or the particles.
  • Up to 16 enabled attractors per block, with at most 256 path segments between them (a closed path counts its closing segment), can be exported to the GPU renderer.
  • A disabled attractor is kept in the field but contributes nothing.
  • Supported by JavaScript v1.1, C# v1.2 and the GPU export; older runtimes report that the effect uses an unsupported block.