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

**URL:** <https://forums.unrealengine.com/t/is-it-a-good-practice-to-have-method-variations-just-for-event-registering-situations/1770211>\
**Category:** Verse\
**Tags:** unreal-editor-for-fortnite, fortnite-creative, question, fortnite\
**Created:** [March 24, 2024, 6:00pm UTC](https://forums.unrealengine.com/t/is-it-a-good-practice-to-have-method-variations-just-for-event-registering-situations/1770211 "2024-03-24T18:00:49Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![t.tutiya](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/t.tutiya/32/924637_2.png) [@t.tutiya](https://forums.unrealengine.com/u/t.tutiya)\
**Post date:** [March 25, 2024, 2:10am UTC](https://forums.unrealengine.com/t/is-it-a-good-practice-to-have-method-variations-just-for-event-registering-situations/1770211/3 "2024-03-25T02:10:45Z")

</div>

I hope you find this article helpful.

> [@Where can I get the ‘agent’ to be used here?(switch\_device ver.)](https://forums.unrealengine.com/t/where-can-i-get-the-agent-to-be-used-here-switch-device-ver/1277212):
>
> If I want to toggle SwitchA when 10 seconds have elapsed from the start of the game, what should I specify as the Agent? In this case, there is no instigator to toggle the switch The following code seems redundant(Sorry, Not tested.). TeamCollection := GetPlayspace().GetTeamCollection() if: Teams := TeamCollection.GetTeams() Agents := TeamCollection.GetAgents[Teams[0]] Agent := Agents[0] then: SwitchA.ToggleState(Agent) #SwitchA : switch\_device Thank you.

```auto
if:
    Agent := GetPlayspace().GetPlayers()[0]
then:
    SwitchDevice.ToggleState(Agent)

```

---

_[View the full topic](https://forums.unrealengine.com/t/is-it-a-good-practice-to-have-method-variations-just-for-event-registering-situations/1770211)._
