Where is SUBSCRIBEAGENT ??

Hi!

I’m working with Verse in UEFN and I’m using a trigger_device.
I noticed that in several recent YouTube tutorials, creators are using the SubscribeAgent method on the TriggeredEvent, like this:

Trigger.TriggeredEvent.SubscribeAgent(OnTrigger, index)

However, in my project, the SubscribeAgent function does not appear or is not recognized for my triggers – only the standard Subscribe method is available.

Is there something I need to enable or import in order to use SubscribeAgent? Do I need a specific project template, device version, or beta access?

Any help or clarification would be greatly appreciated!

Thank you in advance!

It’s a extension you can define yourself, such as with this.

(Listenable : listenable(agent)).SubscribeAgent(OutputFunc : tuple(agent, t)->void, ExtraData : t where t:type) : cancelable =
    Wrapper := wrapper_agent(t){ExtraData := ExtraData, OutputFunc := OutputFunc}
    Listenable.Subscribe(Wrapper.InputFunc)
 
wrapper_agent(t : type) := class():
    ExtraData : t;
    OutputFunc : tuple(agent, t) -> void
    InputFunc(Agent : agent):void = OutputFunc(Agent, ExtraData)
 
(Listenable : listenable(tuple())).SubscribeEmpty(OutputFunc : t -> void, ExtraData : t where t:type) : cancelable =
    Wrapper := wrapper_empty(t) {ExtraData := ExtraData, OutputFunc := OutputFunc}
    Listenable.Subscribe(Wrapper.InputFunc)
 
wrapper_empty(t : type) := class():
    ExtraData : t;
    OutputFunc : t -> void
    InputFunc():void = OutputFunc(ExtraData)

I don’t recall where I got this from, or I’d include the link.

Hope it helps.