API ReferenceGE Extensionsflowgraphnodesscene
Show/Hide Object (Flowgraph Node)
- **Node Name:** `Show/Hide Object`
Overview
- Node Name:
Show/Hide Object - Category:
repeat_instant - File:
extensions/flowgraph/nodes/scene/hide.lua
Shows or hides a scene object by toggling its hidden property.
Pin Schema
Input Pins
| Pin | Type | Description |
|---|---|---|
objID | number | Id of the object to show or hide |
hide | bool | When true, hides the object; when false (or nil), shows it |
Behavior
work()- Each frame:- Validates
objIDis provided (sets a node error if missing). - Finds the object via
scenetree.findObjectById(objID). - Sets
obj.hiddento thehidepin value (defaults to false). - Calls
obj:updateInstanceRenderData()if available to refresh rendering.
- Validates
Key Dependencies
scenetree.findObjectById(id)- Finds the target scene objectobj.hidden- Boolean property controlling visibilityobj:updateInstanceRenderData()- Forces a render data refresh
How It Works
A simple visibility toggle node. Sets the object's hidden flag and refreshes its render data. The updateInstanceRenderData() call ensures the change takes effect immediately for objects that use instanced rendering (like TSStatic). The node reports an error in the editor if objID is not connected.
Example Usage
-- Hide an object during a cutscene
-- Wire objID from an ID by Name node
-- Wire hide = true to hide, false to show
-- Useful for revealing/hiding mission props, barriers, triggersAdditional 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