Lifecycle
A spawned copy is either new or taken from a pool. Both get the same events, but a pooled copy keeps its structure and gets its values reset.
- A new copy runs
Ready, thenOnSpawned(). - A pooled copy gets the values it had when it was built: component fields, child poses and enabled flags, and every script field back to its default and its prefab value.
Readydoes not run again,OnSpawned()does. DespawnrunsOnDespawned(), turns the copy off at once and parks it at the end of the frame: its coroutines and signal connections end, its scripts stop, and it moves under a disabledPoolnode.- Components and children added while the copy was out stay; the pool resets values, not structure.
- A physics body keeps its velocity across a respawn. Set it in
OnSpawned. Spawnsets the pose of 2D copies only; 3D copies keep the prefab's pose.