API ReferenceGE Extensionsflowgraphnodesscene
Get Object Field (Flowgraph Node)
- **Node Name:** `Get Object Field`
Overview
- Node Name:
Get Object Field - Category:
repeat_instant - File:
extensions/flowgraph/nodes/scene/getObjectField.lua
Reads a field value from a scene object by its ID and field name. Supports both static fields and dynamic data fields.
Pin Schema
Input Pins
| Pin | Type | Description |
|---|---|---|
objectId | number | The id of the object to read from |
fieldName | string | The name of the field to read |
fieldArrayNum | number | Optional array index for the field (default: 0, hidden) |
Output Pins
| Pin | Type | Description |
|---|---|---|
value | any | The field value |
Behavior
work()- Each frame:- Validates that
objectIdandfieldNameare provided. - Finds the object via
scenetree.findObjectById(objectId). - If the field exists in
obj:getFields(), reads it withobj:getField(fieldName, arrayNum). - Otherwise, tries
obj:getDynDataFieldbyName(fieldName, arrayNum)for dynamic fields.
- Validates that
Key Dependencies
scenetree.findObjectById(id)- Finds a scene object by numeric IDobj:getFields()- Returns the object's static field definitionsobj:getField(name, index)- Reads a static field valueobj:getDynDataFieldbyName(name, index)- Reads a dynamic data field
How It Works
The node first checks if the requested field is a standard object field (defined in the class schema). If found, it reads it directly. If not, it falls back to dynamic data fields - user-defined key-value pairs that can be attached to any object. This two-tier lookup covers both engine-defined properties and custom mission data.
Example Usage
-- Read the position of a scene object
-- objectId = <from ID by Name node>
-- fieldName = "position"
-- Read a custom dynamic field
-- fieldName = "myCustomData"
-- Useful for reading mission-specific data attached to scene objectsSee Also
- Collection Marker (Flowgraph Node) - Related reference
- Custom Lua Command (Flowgraph Node) - Related reference
- Get Player Vehicle ID (Flowgraph Node) - Related reference
- FlowGraph Guide - Guide