Scene
class in OpalScript
Find, spawn, and destroy entities in the current Play world.
Methods
| Member | Description |
|---|---|
| Scene.FindAll | Snapshot all live scene entities in scene order, at most 1,024, charged to the script query budget. |
| Scene.FindInGroup | Snapshot live entities whose trimmed Group or Team name matches the supplied trimmed name, in scene order. Disabled Team tags still match, and Health does not filter results. Empty matches all live entities. At most 1,024 matches; scanning is charged to the script query budget. |
| Scene.FindByName | Find the first live entity with this exact name in the current scene, or null. |
| Scene.FindById | Find a live entity by its exact scene id, or null. |
| Scene.Destroy | During Play, destroy an entity and its subtree through the world lifecycle. Null or expired references do nothing. |
| Scene.Spawn | Spawn a referenced, preloaded prefab immediately during Play, or fail before activation when unavailable. |
| Scene.SpawnConfigured | Spawn a preloaded prefab before its Start hooks, calling this component's synchronous void initializer(Entity), or initializer(Entity, T) with a fourth typed payload. The initializer name must be a string literal. Payloads are immutable values or a single lifetime-checked Entity; mutable lists, components and task handles are excluded. |
| Scene.FindWith | An ordered snapshot of live entities with an enabled component T. At most 1,024 results; queries share the world index and script budgets. |
| Scene.FindInRadius | Live entities with an enabled component T whose world origins are within the inclusive radius of center. Scene order, at most 1,024 results. Radius must be finite and nonnegative. |
| Scene.FindNearest | The nearest live entity with an enabled component T within the inclusive radius of center, or null. Equal distances retain scene order. Radius must be finite and nonnegative; work is budgeted without allocating a result list. |