API ReferenceGE Extensionsflowgraphnodesmathvector
Merge (Flowgraph Node)
- **Node Name:** `Merge`
Overview
- Node Name:
Merge - Category:
simple - File:
extensions/flowgraph/nodes/math/vector/merge.lua
Merges up to 4 individual number components into a single table (vec3, color, or quat).
Pin Schema
Input Pins
| Pin | Type | Description |
|---|---|---|
x | number | First element |
y | number | Second element |
z | number | Third element |
w | number | Fourth element |
Output Pins
| Pin | Type | Description |
|---|---|---|
value | vec3 / color / quat | All elements packed into a table |
How It Works
- Each frame, the node reads the four input pins (x, y, z, w).
- It packs them into a Lua table:
{x, y, z, w}. - Nil inputs remain nil in the table.
- The output type is polymorphic - it can be connected to vec3, color, or quat pins.
This is the counterpart to the Split node.
Lua Example
-- Build a position from separate coordinates:
-- x = vehicle X position
-- y = vehicle Y position
-- z = terrain height
-- value output → vec3 position for teleport
-- Build a color:
-- x = red (0-1), y = green, z = blue, w = alpha
-- value output → color for UI elementKey Dependencies
_flowgraph_createNode()- standard flowgraph node registration
Additional Methods
C:init()
Initializes the node, setting up pins and default properties.
C:work()
Main work function called each frame/tick when the node is active.
See Also
- Split (Flowgraph Node) - Related reference
- FlowGraph Guide - Guide