On Update
Type: Entry Point
Category: EVENT
Entry point that executes every frame. It is the root of most continuous logic trees — movement, AI, input detection, etc.
Properties
None.
Sockets
| Socket | Direction | Type |
|---|---|---|
| Exec | Output | Exec |
No input socket — this is the root of the tree.
When it executes
Every frame, while the object exists in the scene. The frequency depends on the game's framerate. For logic that should not run every frame, use Delay, Gate, or AI nodes with Perception Interval.
Typical usage
Full AI pipeline
[On Update] → [Enemy Perception]
→ [Damage Receiver]
→ [AI State Machine]
→ [Enemy Movement]
→ [Enemy Animation]
Player input
[On Update] → [On Key Press: W, Held]
├── True ──► [Player Movement: forward]
└── False ──► (nothing)
Periodic timer
[On Update] → [Delay: 2.0s, Repeat=True]
└── True ──► [BTCustomTask: update_minimap()]
Multiple On Update nodes in the same tree
A tree can have several On Update nodes. Each is an independent chain that executes in the same frame:
[On Update] → [movement logic]
[On Update] → [combat logic]
[On Update] → [animation logic]
This is equivalent to chaining everything, but allows organizing the graph visually.
Note about the editor button
The On Update node shows a "Copy component to clipboard" button in the properties panel. Clicking it copies the full generated Python code of the component to the clipboard — useful for debugging or inspecting compiled code.
Notes
- Code generated by On Update is placed in the
update(self)method of the component. Range.logic.deltaTime()is available in any node connected to On Update — it's the time in seconds since the previous frame.- If the game runs slowly (low framerate),
deltaTimeis larger — nodes that usedeltaTime(movement, timers) compensate automatically. - For tasks that don't need to run every frame, use the modular system with
Perception Interval, or wrap in a Gate or Delay node.