Focused reference · Unreal Engine 5.8
Communication patterns
Direct reference
Use when one caller owns or is explicitly configured with one target.
- Expose an object reference, assign it at spawn/configuration, or obtain it from a known framework relationship.
- Validate the reference at the use boundary.
- Call the typed function directly.
This is the clearest option. A cast does not find an object; it only tests/converts an existing reference. Avoid repeated discovery calls.
Blueprint Interface
Use when the caller has a target but multiple unrelated classes implement the operation.
- Create a Blueprint Interface containing the smallest stable function contract.
- Implement it on each responder.
- Obtain a target reference through overlap, trace, ownership, configuration, or spawn.
- Call the interface message on that reference.
- Define what a non-implementing target means; do not silently depend on a response.
Example: an interaction trace calls Interact on doors, pickups, and terminals without
casting to each concrete class.
Event Dispatcher
Use when one known publisher emits a signal to zero or more listeners.
- Declare the dispatcher on the publisher.
- Give the payload the minimum data listeners need.
- Listeners obtain the publisher and bind once during a defined lifecycle event.
- Publisher calls the dispatcher after its authoritative state change.
- Listeners unbind on teardown or when switching publishers.
The publisher owns the event; listeners own their reactions. Guard against duplicate binds.
Subsystem or message router
Use for deliberately scoped many-to-many communication, not as a default.
- Choose lifetime: GameInstance, World, or LocalPlayer.
- Define message channel identifiers and payload structs.
- Register listeners and retain handles where the API requires them.
- Broadcast only after authoritative state is valid.
- Log channel, source, target scope, and payload in development builds.
- Unregister on teardown.
Global messaging hides dependency and ordering. Document who may publish, whether messages cross the network, and whether late subscribers need current state separately.
Choice table
| Relationship | Pattern |
|---|---|
| One caller → one concrete target | Direct reference |
| One caller → one target behind a shared contract | Interface |
| One publisher → many listeners | Event Dispatcher |
| Many publishers → many listeners | Scoped message router |
| Listener needs current value, not merely an occurrence | Query owned state, then subscribe to changes |