magnet

Objects drift toward the pointer, each held within a short reach of its place.

Usage

Set interaction="magnet" on the scene. Interactions are scene rules: they work on every object inside, whatever its type. Several run in the order written.

Options

AttributeTypeDefaultRangeDescription
magnet-reachnumber400 to 200Farthest drift from rest (px)
magnet-strengthnumber0.30 to 1Pull strength

License

MIT. Use it anywhere, credit appreciated.