delegates.subscribe
Observes matching Unreal UFunction calls with a Lua callback.
Syntax
ue.delegates.subscribe(target: UObjectProxy?, function_name: string, callback: function) -> integerParameters
| Parameter | Type | Description |
|---|---|---|
target | UObjectProxy? | Object to observe, or nil for any object. |
function_name | string | Receiving UFunction or event name. |
callback | function(sender, params) | Called after Unreal executes the function. |
Returns
| Type | Description |
|---|---|
integer | Subscription ID. |
Example
local id = ue.delegates.subscribe(
player,
"ReceiveAnyDamage",
function(sender, params)
print(params.Damage)
end
)Notes
- Callbacks are read-only observers.
- Off-game-thread events are ignored.
- Keep
niltarget subscriptions narrowly filtered.