Live Instances and Instance Sets
An Instance identifies one live Object. An Instance Set holds several live Objects. Use these types when you need to remember a collision participant, keep a created Object, or act on a group.
An Object Thing selects a reusable resource to create. An Instance selects something already running. A resource name cannot replace a live handle.
Prerequisites
Prepare a placed Object with a Logic Component. Create a second Object definition for a spawn check. Use the declaration and target pickers so the editor can check the reference type and optional Object Kind.
Keep a Created Instance
- Add Create Instance and select the second Object definition.
- Set Created As to
pieceand choose a visible position. - Add a following Action, such as Set Position or Set Velocity, with Applies To set to
piece. - Run the Event and inspect the new Object.
Expected result: the following Action affects the exact instance created by that invocation. Created As is a local result name. It is available to later Actions in the same Event or Function and disappears when that invocation finishes.
Declare an Instance or Instance Set Variable when the reference must survive another Event. These declarations start as None and have no authored live default. Use the supported assignment picker to store the live result; a literal name does not create it.
Maintain a Group
Make Instance Set creates a named set in the current invocation. Add To Instance Set retains its existing members and adds the selected target. Set Instance Set replaces the members; selecting Nothing empties it.
For a longer-lived group, declare an Instance Set Variable. After Create Instance with Created As piece, use Set Instance Set to replace that Variable’s contents with piece, or Add To Instance Set to accumulate several created Objects. Target the set in a later supported Action.
Create Instance can reuse the same local result name on each iteration of Repeat. Add each result to the group before the next iteration changes that name. Target the group in a later Action and check that every intended member responds.
Use Event Participants and Contracts
Collision Events that expose Other Instance supply a typed reference to the contacted Object. Store it when you need that exact participant later. Check that it still exists before reading or changing its components.
Instance Parameters, Outputs, Variables, Globals, and Data Structure fields can carry live references. Data Tables cannot author them. An optional Object Kind limits component access to the declared compatible Object contract. Access to a named health slot still requires that slot and type.
Instances have no numeric arithmetic or Text conversion. Use compatible target fields and component pickers. See Parameters and Object contracts for nominal and structural compatibility.
Troubleshooting
If a result name is missing, check its scope and whether the Create runs on every path reaching the consumer. If an Instance is None, check assignment, Object destruction, and Scene lifecycle. Retaining a handle does not keep a destroyed Object alive.
If a group loses earlier members, check whether Set Instance Set replaced them. If several Objects move when you expected one, inspect Applies To and whether it selects a set or an Object-wide query.
See Values and Things, Variables and shared state, Object Actions, and Scene lifecycle.
Myth Engine Documentation
