# How do i convert from type ?agent to agent... im so confused with optionals

**URL:** <https://forums.unrealengine.com/t/how-do-i-convert-from-type-agent-to-agent-im-so-confused-with-optionals/1258390>\
**Category:** Verse\
**Tags:** unreal-editor-for-fortnite, fortnite-creative, fortnite\
**Created:** [August 12, 2023, 2:23am UTC](https://forums.unrealengine.com/t/how-do-i-convert-from-type-agent-to-agent-im-so-confused-with-optionals/1258390 "2023-08-12T02:23:27Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![Twin01](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/twin01/32/1077777_2.png) [@Twin01](https://forums.unrealengine.com/u/Twin01)\
**Post date:** [August 12, 2023, 8:23pm UTC](https://forums.unrealengine.com/t/how-do-i-convert-from-type-agent-to-agent-im-so-confused-with-optionals/1258390/3 "2023-08-12T20:23:44Z")

</div>

Like this:

```auto
 Foo(MaybeAgent: ?agent): void =
        if (Agent := MaybeAgent?):
            # Do stuff with 'Agent'

```

---

_[View the full topic](https://forums.unrealengine.com/t/how-do-i-convert-from-type-agent-to-agent-im-so-confused-with-optionals/1258390)._
