Is it a good practice to have method variations just for event-registering situations?

While trying to register a method to an AreaCaptureDevice, I had to place a parameter in the method, in order to be able to register it:
image

And now I also want to call this function inside OnBegin() and other places, but I need to pass this Agent parameter, and I don’t really have (or need it) in the context of that code.

How should I proceed in this kind of situation? Should I make 2methods, one just for registering and one for generic situations? Or is there an easy way to get this agent as parameter, even trough I don’t have or need it at that moment?

if im understanding you properly the agent is passed from the event you Subscribed to.

you dont have to use it it but it is a requirement for you to be able to use the subscribe as far as im aware

I hope you find this article helpful.

if:
    Agent := GetPlayspace().GetPlayers()[0]
then:
    SwitchDevice.ToggleState(Agent)
1 Like