You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit fe5d822
Browse filesBrowse the repository at this point in the historyBrowse files
[docs] the Spawn node, and build-a-game on the collectible module
- nodes/spawn.md: what a spawner is for, the four parameters and the 200
global ceiling, that `at` is an OFFSET from the template rather than a
world position, and the crate-dispenser walkthrough. Plus the four
things that read as bugs until you know them: nothing fires until the
next real press after wiring (the stale-stamp guard that stops a node
spawning on connect), stopping the sim removes every copy and undo will
not bring them back, saving mid-run saves the template only, and a copy
does not carry the template's clips/flow/shader graph.
- build-a-game: the collectible section now installs the module from
Browse and uses its one node instead of core's old seven-node recipe,
covers all six params incl. per-player scope and the touch trigger, and
says that legacy scenes keep working.
The mkdocs Splines entry and the terrain/controls edits pending in this
checkout belong to the 21-C batch and are deliberately left uncommitted.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
**Output:** effect (or wire the template into `source`)
7
+
8
+
## How it works
9
+
10
+
On the **rising edge** of whatever is wired into `trigger` — [Key Press](keypress.md), [On Click](onclick.md), [Timer](timer.md), [On Enter](onenter.md) — the node copies its **template** object and drops the copy into the scene with a live physics body. The copy inherits the template's physics, material and geometry, so a dynamic template gives you something that falls.
11
+
12
+
Copies are **transient**. They live for the run and nothing else: they are never written into a saved scene, they leave nothing on the undo stack however many times you fire, and they all disappear when the simulation stops. That is the whole design — a run's debris is not scene content.
13
+
14
+
The peer running the simulation makes the copy and everybody else receives it through the ordinary object sync, so two peers never disagree about what exists. Nothing extra goes on the wire for this node.
15
+
16
+
!!! warning "It needs a running simulation"
17
+
A copy made with physics stopped would be inert, which is exactly the problem this node exists to remove — so with nothing simulating it refuses and says so instead of quietly doing nothing. Press <kbd>P</kbd> (or the ▶ button) **in the editor** first. You cannot start a simulation from inside Play mode; if you want both, turn on *simulate on play* in the scene's physics settings.
18
+
19
+
!!! tip "Give the template a body"
20
+
If the template has no physics, the copies just hang in the air where they appear. Select it, then Inspector ▸ Physics ▸ Mode = *Dynamic*. The node warns you once when it notices.
21
+
22
+
## Parameters
23
+
24
+
| Parameter | Default | Meaning |
25
+
|---|---|---|
26
+
| copies per fire | 1 | how many appear per event (hard limit 20) |
27
+
| max alive | 32 | how many this spawner keeps alive; when it is full, the **oldest** copy disappears as each new one arrives |
28
+
| min seconds between | 0 | a floor between fires. A trigger edge is not a rate limit on its own — a *held* key re-fires several times a second |
29
+
| spread | 0.5 | metres of random scatter, so a batch does not stack in one column |
30
+
31
+
There is also a **ceiling of 200 live copies across every spawner in the scene**, whatever the individual numbers say. An unbounded spawner in a shared session is both a memory problem and a griefing vector, so the limits are enforced when the copies are made and not merely suggested on the card.
32
+
33
+
## Where the copies appear
34
+
35
+
The `at` input (and the x/y/z on the card) is an **offset from the template**, not a world position — so a node with nothing wired drops copies just above an object you can already see. Wire a [Vector3](vector3.md) into `at` to aim it, or a [Math](math.md) chain if you want the point to move.
-**Nothing at all**, if the Spawn node lives in an object's own flow (double-click the object in the node editor's Graphs tree) — it copies that object.
43
+
- Keep the template somewhere visible in the scene. It stays editable, and a scene file that ships a spawner is self-documenting because you can see what it makes.
44
+
45
+
## Practical example
46
+
47
+
**A crate dispenser on a key.**
48
+
49
+
1.`/create box`, then Inspector ▸ Physics ▸ Mode = *Dynamic*. This is the template — move it somewhere visible and off the floor.
4. Add an **Object Selector** naming the box → Spawn `source`.
53
+
5. Press <kbd>P</kbd> to start physics, then <kbd>G</kbd>: a copy appears 3 m above the template and falls.
54
+
55
+
**A burst.** Set *copies per fire* to 5 — five at once, scattered by *spread*.
56
+
57
+
**A capped fountain.** Set *max alive* to 8 and hold <kbd>G</kbd>: the count climbs to 8 and stays there, the oldest copy vanishing as each new one lands. That is the recycling, and it is what makes a spawner safe to leave running.
58
+
59
+
**A conveyor.** Drive `trigger` from a [Timer](timer.md) and set *min seconds between* to 2 for one crate every couple of seconds.
60
+
61
+
## Things worth knowing
62
+
63
+
-**Nothing spawns until the next real press** after you wire up a fresh Spawn node to a trigger that has already fired. That is deliberate: without it, a node arriving on a peer would adopt the last stamp it sees and spawn on connect.
64
+
-**Stopping the simulation removes every copy at once**, and <kbd>Ctrl</kbd>+<kbd>Z</kbd> will not bring them back — there is nothing to undo, by design.
65
+
-**Saving mid-run saves the template only.** Reload a scene you saved with forty crates in the air and you get the one box back.
66
+
- A copy does not carry the template's animation clips, object flow or shader graph. Each of those replicates a whole document per object, and volume is a spawner's whole point.
67
+
68
+
## See also
69
+
70
+
-[Impulse](impulse.md) — shove a copy the moment it appears
71
+
-[On Rest](onrest.md) — fire when a spawned body has settled
72
+
-[Counter](counter.md) — count what you have made
73
+
-[Physics](../physics.md) — bodies, ground, gravity and the simulation controls
0 commit comments