# Where can I get the 'agent' to be used here?

**URL:** <https://forums.unrealengine.com/t/where-can-i-get-the-agent-to-be-used-here/827857>\
**Category:** Verse\
**Tags:** unreal-editor-for-fortnite, fortnite-creative, question, fortnite\
**Created:** [March 27, 2023, 3:56pm UTC](https://forums.unrealengine.com/t/where-can-i-get-the-agent-to-be-used-here/827857 "2023-03-27T15:56:51Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kalusss](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/kalusss/32/933072_2.png) [@Kalusss](https://forums.unrealengine.com/u/Kalusss)\
**Post date:** [March 27, 2023, 3:56pm UTC](https://forums.unrealengine.com/t/where-can-i-get-the-agent-to-be-used-here/827857/1 "2023-03-27T15:56:51Z")

</div>

I want to make a player who clicked a button on my main canvas to be shown the Class Selector UI, but in order to do that, I need an agent. How can I get that within this function?

```auto
HandleSelectedUIButton(Message : widget_message) : void =
        if (PlayerUI := GetPlayerUI[Message.Player], MyUI := MaybeMyUIPerPlayer[Message.Player]?, SelectedButton := text_button_base[Message.Source]):
            Print("Player selected {SelectedButton.GetText()}")
            PlayerUI.RemoveWidget(MyUI)
            if (set MaybeMyUIPerPlayer[Message.Player] = false) {}
            var SelectedButtonText : string = SelectedButton.GetText()
            MainLoopDevice.Stop()
            if (SelectedButtonText = "Box Fights"):
                BoxFightsClassUiDevice.Show(*Agent : agent*)

```

\*The italicized code is where the error occurs: “Data definitions at this scope must be initialized with a value.” I am new to using Verse, any help is appreciated.

---

<div class="post-metadata">

**Author:** ![DustinREDGames](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/dustinredgames/32/634988_2.png) [@DustinREDGames](https://forums.unrealengine.com/u/DustinREDGames)\
**Post date:** [March 27, 2023, 4:09pm UTC](https://forums.unrealengine.com/t/where-can-i-get-the-agent-to-be-used-here/827857/2 "2023-03-27T16:09:38Z")

</div>

A Player is also an Agent, so just pass the Player reference from the Message.  
`BoxFightsClassUiDevice.Show(Message.Player)`

You can see in the Verse digest that the base class of a Player is an Agent:  
 ![Screenshot (90)](https://d3kjluh73b9h9o.cloudfront.net/original/4X/3/d/5/3d54fb7f3f2ee7547dd1b4062b118163cd5dad66.png)

---

<div class="post-metadata">

**Author:** ![GestorteDorte1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@GestorteDorte1](https://forums.unrealengine.com/u/GestorteDorte1)\
**Post date:** [March 27, 2023, 6:59pm UTC](https://forums.unrealengine.com/t/where-can-i-get-the-agent-to-be-used-here/827857/3 "2023-03-27T18:59:23Z")

</div>

as far as i can tell the Player is an agent, so you might pass Message.Player
