Skip to main content
Flow Core Documentation
Menu

Flow Stats

React to Flow Stats Events

Enable one Stats event Trigger and turn a committed Resource change into visible feedback.

Audience
Gameplay designers and developers
Time
15 minutes
Requires
The supplied 7. Stats example
Modules
Flow Stats
On this page

Goal

React to a committed Health change without polling every frame. Enable the component-owned Stats Resource Changed Trigger, filter its immutable Definition snapshot to Health, and log the committed Current value.

Prerequisites

  • Import the Flow Core examples.
  • Be able to enter Play Mode in the supplied 7. Stats scene.
  • Keep the Game view and Console visible for verification.

The supplied example keeps all standard Stats Triggers disabled. Work in a duplicate scene so this tutorial does not alter the shipped example.

What You Will Build

Damage 10
Health: 60 -> 50
Stats Resource Changed
Definition: Health
Current Current: 50

Steps

1. Prepare a safe scene copy

  1. Find and open the scene named 7. Stats.
  2. Save a copy in a project-owned tutorial folder.
  3. In the Hierarchy, select Standalone Stats Demo.
  4. In its Flow Stats component, open the Events tab.

The event graph is embedded in this component. Editing the duplicated component leaves the original example unchanged.

2. Open the Stats event graph

  1. Keep Storage Mode set to Embed.
  2. Select Repair Standards if the standard Stats Triggers are missing.
  3. Select Open Event Graph.
  4. Find Stats Resource Changed and enable that Trigger only.

Repair Standards restores standard Trigger identities, but it does not enable them. Disabled Triggers create no Stats event-graph work.

The Stats Resource Changed Trigger connected to an Action that filters Health and reads its committed Current value.

3. Filter Health and read the committed Current value

Connect Stats Resource Changed to an Action, then configure it in this order:

  1. Enable the Action Guard and add Stats Event Definition Is.
  2. Set its Definition to the supplied Health Resource asset.
  3. Add Stats Event Read Float and set Event Value to Current Current.
  4. Route Value to TempPayload > Float.
  5. Route the optional Result to TempPayload > Bool; this tutorial does not read that channel later.
  6. Add Log Float and read TempPayload > Float.

The Guard checks the canonical Definition asset carried by the event. Current Current then reads the committed Resource value from the immutable Current snapshot. TempPayload keeps both outputs local to the running chain, so this verification does not require a Blackboard or FlowCoreProcess.

For a production route that needs the Definition as data instead of a Guard, use Stats Event Read Definition and branch on the returned canonical asset before producing feedback.

Verify the Result

  1. Open the Game view and Console.
  2. Enter Play Mode.
  3. Confirm that Health starts at 60 / 100.
  4. Select Damage 10 once.
  5. Confirm that Health becomes 50 / 100 and the graph logs 50.

The example’s Last Event label is updated by its sample C# controller. The Console value is the visible proof that the Event Graph route ran.

The running sample after Damage 10, with Health at 50 and the committed Current value visible in a zero-error Console.

Common Mistakes

SymptomCheck
The graph never startsSelect the Trigger and confirm it is enabled; Repair Standards alone does not enable it.
The wrong graph is openIn the component’s Events tab, confirm the active Storage Mode before selecting Open Event Graph.
Another Resource uses the same responseConfirm the Guard is enabled and Stats Event Definition Is references the exact canonical Resource asset.
A value looks different after a WaitRead Previous, Current, or Delta from the immutable Stats event snapshot instead of querying later live state.
The sample label changes but the graph does not highlightThe sample controller also listens in C#; use the Console log and Graph Debug Context to verify the graph route.

What You Built

You enabled one low-frequency Stats event route, filtered its canonical Definition, read a committed Current snapshot, and produced observable feedback without adding a per-frame graph or Blackboard dependency.