API ReferenceGE Extensionsflowgraphnodesscene
Keep Prefab (Flowgraph Node)
- **Node Name:** `Keep Prefab`
Overview
- Node Name:
Keep Prefab - Category:
once_instant - File:
extensions/flowgraph/nodes/scene/keepPrefab.lua
Marks a prefab to be kept after the flowgraph stops. By default, prefabs spawned during runtime are removed at the end.
Pin Schema
Input Pins
| Pin | Type | Description |
|---|---|---|
id | number | The ID of the prefab to be affected |
keep | bool | If the prefab should be kept after stopping |
Behavior
workOnce()- Ifidis provided, callsself.mgr.modules.prefab:setKeepPrefab(id, keep)to flag the prefab.- Passes flow through regardless.
How It Works
- The node fires once when triggered.
- Looks up the prefab by its ID in the flowgraph manager's prefab module.
- Sets the "keep" flag so the prefab persists after the flowgraph execution ends.
Example Usage
-- In a flowgraph, connect this node after a Spawn Prefab node:
-- [Spawn Prefab] --> id --> [Keep Prefab]
-- Set keep = true to preserve the prefab after the graph stopsKey Dependencies
self.mgr.modules.prefab:setKeepPrefab()- flags a prefab to persist beyond flowgraph execution
Additional Methods
C:init()
Initializes the node, setting up pins and default properties.
See Also
- Collection Marker (Flowgraph Node) - Related reference
- Custom Lua Command (Flowgraph Node) - Related reference
- Get Object Field (Flowgraph Node) - Related reference
- FlowGraph Guide - Guide