# How do you get "fort\_character" from type "?agent"

**URL:** <https://forums.unrealengine.com/t/how-do-you-get-fort-character-from-type-agent/882713>\
**Category:** Programming & Scripting\
**Tags:** unreal-editor-for-fortnite, fortnite-creative, question, fortnite\
**Created:** [April 10, 2023, 7:30am UTC](https://forums.unrealengine.com/t/how-do-you-get-fort-character-from-type-agent/882713 "2023-04-10T07:30:56Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![SushiAi](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/sushiai/32/88714_2.png) [@SushiAi](https://forums.unrealengine.com/u/SushiAi)\
**Post date:** [April 10, 2023, 7:36am UTC](https://forums.unrealengine.com/t/how-do-you-get-fort-character-from-type-agent/882713/2 "2023-04-10T07:36:05Z")

</div>

Solved this by doing the following…

- Created a new const “Agent” of type “agent”
- Set “Agent” equal to “QAgent?”
- Called “GetFortCharacter[]” on the new const “Agent”

Looks like the question mark at the end handles the “false” check

```auto
OnTriggered(QAgent: ?agent): void=
  if (QAgent <> false, Agent: agent = QAgent?):
  
      if (FortChar := Agent.GetFortCharacter[]) {
          Print("Killing player")
          FortChar.Damage(100.0)
      }
```

---

_[View the full topic](https://forums.unrealengine.com/t/how-do-you-get-fort-character-from-type-agent/882713)._
