Flowgraph Visual Scripting
Introduction to BeamNG's node-based visual scripting system for missions, scenarios, and gameplay logic.
Flowgraph is BeamNG's built-in visual scripting system. It lets you create scenarios, missions, and gameplay logic by connecting nodes in a graph — no Lua coding required. If you've used Unreal Blueprints or Unity Visual Scripting, the concept is similar.
Opening the Editor
- Press F11 to open the World Editor
- Go to Window → Gameplay → Flowgraph Editor
The editor shows a canvas where you place and connect nodes. Right-click to open the node browser and add nodes to the graph.
Core Concepts
Nodes
Nodes are functional blocks that perform a specific action — spawn a vehicle, wait for a timer, display UI, check a condition. Each node has input pins (left side) and output pins (right side).
Pins
Pins are color-coded by data type:
- Green — Flow pins (execution order)
- Yellow — Vector data
- Other colors — Numbers, strings, booleans, etc.
Flow pins control when a node executes. Data pins pass what data to use.
Links
Links are connections between pins. Drag from an output pin to an input pin to create a link. Flow links determine execution order; data links pass values between nodes.
Creating a Graph
- Right-click on the canvas → browse the Node Library
- Add an onUpdate node (triggers every frame) or an event trigger
- Add action nodes (spawn vehicle, display message, set timer)
- Connect flow pins to define execution order
- Connect data pins to pass values
- Press Play to run the graph
Key Node Categories
The flowgraph system includes hundreds of nodes organized into categories:
| Category | Examples |
|---|---|
| Vehicle | Spawn, despawn, control, get vehicle data |
| UI | Flash messages, end screens, task lists, buttons |
| Logic | Flow switches, gates, conditionals, loops |
| Math | Arithmetic, comparisons, trigonometry |
| Mission | Mission start/end, objectives, checkpoints |
| Audio | Play sounds, music control |
| Environment | Time of day, weather, gravity |
| Scene | Object manipulation, transforms |
| Input | Key press detection, input bindings |
| Timers | Wait, countdown, interval |
| Career | Career-specific progression nodes |
| States | State machine nodes for mission phases |
| Recording | Replay and recording control |
Browse the full library in the editor via Window → Node Library for previews and descriptions of each node.
Modules
Modules provide shared state and services to nodes within a flowgraph. They act as persistent backends that nodes can reference.
Modules follow a lifecycle: init(mgr) → executionStarted() → onUpdate(dtReal, dtSim, dtRaw) → executionStopped() → clear(). The moduleOrder property controls which modules update first.
Stategraphs
For missions with multiple phases (intro, gameplay, retry, success, failure), flowgraph supports stategraphs — state machines where each state contains its own flowgraph. This is how the game's built-in missions manage phase transitions.
Connecting to Missions
Flowgraphs are the primary way to build missions and scenarios in BeamNG. A typical mission structure:
- Setup phase — Spawn vehicles, position camera, display intro UI
- Gameplay phase — Monitor objectives (checkpoints, timers, damage thresholds)
- End phase — Display results, award progress, clean up
The career and mission systems use flowgraph extensively — exploring the game's built-in missions is one of the best ways to learn.
Tips
- Group nodes with comments to keep complex graphs readable
- Test iteratively — press Play frequently to verify small changes
- Explore the Node Library — there are hundreds of nodes; browsing them reveals capabilities you might not expect
- Use subgraphs to encapsulate reusable logic into prefabs
- Check built-in missions for real-world examples of flowgraph patterns
See Also
- Flowgraph Base Module — Module lifecycle and factory pattern
- Flowgraph Builder — Visual rendering and node layout internals
- Flowgraph Variable Storage — Variable persistence system
- Hook Catalog — Hooks that flowgraph nodes can listen to