# How to convert "agent" to "?agent"

**URL:** <https://forums.unrealengine.com/t/how-to-convert-agent-to-agent/1642292>\
**Category:** Verse\
**Tags:** unreal-editor-for-fortnite, fortnite-creative, question, fortnite\
**Created:** [January 25, 2024, 8:27pm UTC](https://forums.unrealengine.com/t/how-to-convert-agent-to-agent/1642292 "2024-01-25T20:27:01Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Shoka](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/shoka/32/1169404_2.png) [@Shoka](https://forums.unrealengine.com/u/Shoka)\
**Post date:** [January 25, 2024, 8:27pm UTC](https://forums.unrealengine.com/t/how-to-convert-agent-to-agent/1642292/1 "2024-01-25T20:27:01Z")

</div>

I know how to convert an “?agent” to an “agent”:

if (MaybeAgent := Agent?):  
Do stuff with MaybeAgent (agent)

But what about converting an “agent” to “?agent” for some methods that request an “?agent” as parameters instead of “agent”?

---

<div class="post-metadata">

**Author:** ![EisStudios](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/eisstudios/32/885240_2.png) [@EisStudios](https://forums.unrealengine.com/u/EisStudios)\
**Post date:** [January 26, 2024, 10:23pm UTC](https://forums.unrealengine.com/t/how-to-convert-agent-to-agent/1642292/2 "2024-01-26T22:23:06Z")

</div>

You’d simply use `option{agent}`.

> **[Option](https://dev.epicgames.com/documentation/en-us/uefn/option-in-verse)**
>
> The option type can contain one value or can be empty.

---

<div class="post-metadata">

**Author:** ![Rodriges2.7](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Rodriges2.7](https://forums.unrealengine.com/u/Rodriges2.7)\
**Post date:** [February 2, 2024, 12:34pm UTC](https://forums.unrealengine.com/t/how-to-convert-agent-to-agent/1642292/3 "2024-02-02T12:34:43Z")

</div>

Hey i am super lost right now and saw that you understand Agents so i thought i would ask you. I am triing to get the tracker Value only for the the Player playing right now but it switches betwen all players (i only tried it with two) showing my tracked value and the my enemies would be souper happy over some help 🙂

this is my code:  
OnBegin():void =

```auto
    loop: 
        for. Player : (GetPlayspace().GetPlayers())
        do:
            TargetValue := Tracker.GetValue(Player)
            Print("Tracker is at {TargetValue}")

```

---

<div class="post-metadata">

**Author:** ![EisStudios](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/eisstudios/32/885240_2.png) [@EisStudios](https://forums.unrealengine.com/u/EisStudios)\
**Post date:** [February 2, 2024, 1:41pm UTC](https://forums.unrealengine.com/t/how-to-convert-agent-to-agent/1642292/4 "2024-02-02T13:41:41Z")

</div>

**For future reference, you should just open a new topic, as this just makes the thread a lot more messy, and people with the same issue won’t be able to find this as easily.**

I’m not sure that I understand you correctly, but it seems like you’re trying to do what you describe as your issue. You’re looping through every player and printing their tracked value… but you only want one player?

Verse doesn’t really know which player you want to reference (someone who opened a door, the person with the most kills, the first person to join?), so we can’t really tell it to just pick one player (at least not with the given context).

Please either take this advice and try to figure out what you’re actually trying to do or elaborate in a new topic 🙂

---

<div class="post-metadata">

**Author:** ![system](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/1/3/713c9d3f58553f0de89543d76a8a3a2779dc9fa4.png) [@system](https://forums.unrealengine.com/u/system)\
**Post date:** [March 3, 2024, 1:42pm UTC](https://forums.unrealengine.com/t/how-to-convert-agent-to-agent/1642292/5 "2024-03-03T13:42:42Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
