RLS Studios
ProjectsPatreonCommunityDocsAbout
Join Patreon
BeamNG Modding Docs

Guides

Reference

Server CommandsGE UtilitiesGame Engine MainNavigation GraphScreenshot CaptureServerServer ConnectionSpawnpoint ManagerSimulation TimeVehicle SpawningSuspension Frequency Tester
Flowgraph Base ModuleFlowgraph Base NodeFlowgraph Base State NodeFlowgraph Node BuilderFlowgraph GraphFlowgraph Group HelperFlowgraph LinkFlowgraph ManagerNew Node TemplateFlowgraph PinFlowgraph States ManagerFlowgraph UtilsFlowgraph Variable Storage
And (Flowgraph Node)Boolean Expression (Flowgraph Node)Branch (Flowgraph Node)Bundle (Flowgraph Node)Chainflow Branch (Flowgraph Node)Compare (Flowgraph Node)Edge Detector (Flowgraph Node)Flow Switch (Flowgraph Node)Frame Delay (Flowgraph Node)Once (Flowgraph Node)Flow Interval / Rate Limit (Flowgraph Node)Select (Flowgraph Node)Sequencer (Flowgraph Node)Switch Case (Flowgraph Node)Timed Trigger (Flowgraph Node)Wait (Flowgraph Node)XOR (Flowgraph Node)

UI

Resources

BeamNG Game Engine Lua Cheat SheetGE Developer RecipesMCP Server Setup

// RLS.STUDIOS=true

Premium Mods for BeamNG.drive. Career systems, custom vehicles, and immersive gameplay experiences.

Index

HomeProjectsPatreon

Socials

DiscordPatreon (RLS)Patreon (Vehicles)

© 2026 RLS Studios. All rights reserved.

Modding since 2024

API ReferenceGE Extensionsflowgraphnodeslogic

Edge Detector (Flowgraph Node)

- **Node Name:** `Edge Detector`

Overview

  • Node Name: Edge Detector
  • Category: logic
  • File: extensions/flowgraph/nodes/logic/edgeDetect.lua

Detects when an input signal changes value and outputs a single flow pulse. Supports numbers (with threshold), tables, and any other type.

Pin Schema

Input Pins

PinTypeDescription
flowflowInflow for this node
signalanyInput signal to detect change in
thresholdnumberThreshold for numeric change detection (default: 0)

Output Pins

PinTypeDescription
flowflowOutputs flow when signal changes

Legacy Pin Mapping

Old NameNew Name
_in.valueflow
out.valueflow

Behavior

  • work() - Compares the current signal against the last stored value. Change detection logic depends on type:
    • number: Uses math.abs(current - last) > threshold
    • table: Compares element-by-element; uses threshold for numeric elements, equality for others. Also detects length changes.
    • type mismatch: Always detects as changed
    • other types: Simple inequality check (~=)
  • Stores the current signal as lastSignal for the next frame.

How It Works

Each frame, the node compares the incoming signal to what it saw last frame. If the value has changed (beyond the optional threshold for numbers), it outputs flow for one frame. This is useful for triggering actions only when a value transitions, rather than continuously while a condition is true.

The middle of the node displays the last signal value for debugging.

Example Usage

-- Detect when gear changes:
-- signal = currentGear (number)
-- threshold = 0
-- Output flow fires once each time the gear shifts

-- Detect when a table of waypoints changes:
-- signal = waypointList (table)
-- threshold = 0.1 (for position tolerance)
-- Output flow fires when any waypoint moves beyond 0.1 units

Additional Methods

C:drawMiddle(builder, style)

Custom ImGui drawing in the middle section of the node in the editor.

Parameters:

  • builder
  • style

See Also

  • And (Flowgraph Node) - Related reference
  • Boolean Expression (Flowgraph Node) - Related reference
  • Branch (Flowgraph Node) - Related reference
  • FlowGraph Guide - Guide

Compare (Flowgraph Node)

- **Node Name:** `Compare`

Flow Switch (Flowgraph Node)

- **Node Name:** `Flow Switch`

On this page

OverviewPin SchemaInput PinsOutput PinsLegacy Pin MappingBehaviorHow It WorksExample UsageAdditional MethodsC:drawMiddle(builder, style)See Also