# Casting Entity to Player or Agent Fails

**URL:** <https://forums.unrealengine.com/t/casting-entity-to-player-or-agent-fails/2672698>\
**Category:** Issues and Bug Reporting\
**Tags:** unreal-editor-for-fortnite, fortnite-creative, closed, SceneGraph, UEFN, fortnite, verse\
**Created:** [November 7, 2025, 3:25pm UTC](https://forums.unrealengine.com/t/casting-entity-to-player-or-agent-fails/2672698 "2025-11-07T15:25:58Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![Abrizzer](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Abrizzer](https://forums.unrealengine.com/u/Abrizzer)\
**Post date:** [November 7, 2025, 3:25pm UTC](https://forums.unrealengine.com/t/casting-entity-to-player-or-agent-fails/2672698/1 "2025-11-07T15:25:58Z")

</div>

### Summary

When a player overlaps with a mesh\_component expect the entity that returns can be casted to Player or Agent.

### Please select what you are reporting on:

Verse

### What Type of Bug are you experiencing?

Verse

### Steps to Reproduce

1. Create Blank Project.
2. Activate scene graph beta on project settings.
3. Add an empty entity.

This next steps are necessary to avoid another bug that with mesh\_components of basic shapes from UEFN deactivating the collision check from it, keeps colliding.

1. Create a cube with modeling tools.
2. Add collisions to static mesh and set collision to overlap all
3. Add new mesh created to entity.
4. Uncheck Collidable option from it.
5. Add and script to debug this collisions in my case volume\_component
6. Test in a Session

### Expected Result

Entity cast to succeed being a player or agent

### Observed Result

Entity cast fails for both agent and player

### Platform(s)

UEFN, PC

### Upload an image

 ![SetupUEFN.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/0/7/3/0732c033bad24eda8ab33f955f468911f8dbfca1.png)  
 ![SM_Setup.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/1/9/f/19f9167e9f15c3be1c80329918da027062fdb38d.png)  
 ![Logs.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/0/c/a/0caf7086cef9eef06d03b445f198cab78e22dca1.png)  
 ![VerseDigest.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/d/9/9/d99bd45962689b832b0d6f1d2816ceed926f2b3e.png)

### Video

[](https://www.youtube.com/watch?v=GFKYLgFudcA)

### Additional Notes

using { /Verse.org }  
using { /Verse.org/Native }  
using { /Verse.org/SceneGraph }  
using { /Verse.org/Simulation }  
using { /Fortnite.com/Playspaces }

volume\_component := class\<final\_super\>(component):

```
var Subscriptions :[]cancelable = array{}

OnBeginSimulation<override>():void =
    (super:)OnBeginSimulation()
    if(MeshComp := Entity.GetComponent[mesh_component]):
       EntityEnterResult := MeshComp.EntityEnteredEvent.Subscribe(OnEntityEnteredVolume)
       EntityExitResult := MeshComp.EntityExitedEvent.Subscribe(OnEntityExitedVolume)
       set Subscriptions += array { EntityEnterResult }
       set Subscriptions += array { EntityExitResult }

OnEndSimulation<override>():void=
    (super:)OnEndSimulation()
    for(Sub:Subscriptions):
        Sub.Cancel()

OnEntityEnteredVolume(EnteredEntity:entity):void=
    CheckEntityWithRoundManager("[OnEntered]",EnteredEntity)

    if(Agent := agent[EnteredEntity]):
        Print("[OnEntered] Casting [EnteredEntity] to [Agent] succeded")
    else:
        Print("[OnEntered] Casting [EnteredEntity] to [Agent] failed")

    if(Player:= player[EnteredEntity]):
        Print("[OnEntered] Casting [EnteredEntity] to [Player] succeded")
    else:
        Print("[OnEntered] Casting [EnteredEntity] to [Player] failed")

OnEntityExitedVolume(ExitedEntity:entity):void=
    CheckEntityWithRoundManager("[OnExited]", ExitedEntity)

    if(Agent := agent[ExitedEntity]):
        Print("[OnExited] Casting [ExitedEntity] to [Agent] succeded")
    else:
        Print("[OnExited] Casting [ExitedEntity] to [Agent] failed")

    if(Player:= player[ExitedEntity]):
        Print("[OnExited] Casting [ExitedEntity] to [Player] succeded")
    else:
        Print("[OnExited] Casting [ExitedEntity] to [Player] failed")

CheckEntityWithRoundManager(Prefix:string, EntityToCheck:entity):void=
    if:
        Playspace := Entity.GetPlayspaceForEntity[]
        Players := Playspace.GetPlayers()
    then:
        for(Player : Players):
            if:
                PlayerEntity := entity[Player]
            then:
                Print("{Prefix} Player to entity cast succeded")
                if:
                    EntityToCheck = PlayerEntity
                then:
                    Print("{Prefix} Entity is a player")
                    return
        Print("{Prefix} Entity was not a player")

```

---

<div class="post-metadata">

**Author:** ![AtAshTag](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/atashtag/32/997253_2.png) [@AtAshTag](https://forums.unrealengine.com/u/AtAshTag)\
**Post date:** [November 7, 2025, 3:52pm UTC](https://forums.unrealengine.com/t/casting-entity-to-player-or-agent-fails/2672698/2 "2025-11-07T15:52:43Z")

</div>

Found this

> <https://x.com/Guillaume0z/status/1986404945633927455>

---

<div class="post-metadata">

**Author:** ![Abrizzer](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Abrizzer](https://forums.unrealengine.com/u/Abrizzer)\
**Post date:** [November 7, 2025, 4:56pm UTC](https://forums.unrealengine.com/t/casting-entity-to-player-or-agent-fails/2672698/3 "2025-11-07T16:56:12Z")

</div>

Hi! Thanks for the quick reply, just tested it and it does work, Thanks! it’s a nice workaround to this problem

---

<div class="post-metadata">

**Author:** ![AtAshTag](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/atashtag/32/997253_2.png) [@AtAshTag](https://forums.unrealengine.com/u/AtAshTag)\
**Post date:** [November 7, 2025, 4:56pm UTC](https://forums.unrealengine.com/t/casting-entity-to-player-or-agent-fails/2672698/4 "2025-11-07T16:56:47Z")

</div>

Its still bugged tho clearly so this should be left open until its fixed

---

<div class="post-metadata">

**Author:** ![Abrizzer](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Abrizzer](https://forums.unrealengine.com/u/Abrizzer)\
**Post date:** [November 7, 2025, 5:00pm UTC](https://forums.unrealengine.com/t/casting-entity-to-player-or-agent-fails/2672698/5 "2025-11-07T17:00:51Z")

</div>

Yeah I will leave it open.

Thanks again! this unblocked a really big problem on the idea I was testing.

---

<div class="post-metadata">

**Author:** ![Abrizzer](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Abrizzer](https://forums.unrealengine.com/u/Abrizzer)\
**Post date:** [November 30, 2025, 5:44pm UTC](https://forums.unrealengine.com/t/casting-entity-to-player-or-agent-fails/2672698/6 "2025-11-30T17:44:24Z")

</div>

Bug still persist on 39.00

---

<div class="post-metadata">

**Author:** ![Baterka.xyz](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Baterka.xyz](https://forums.unrealengine.com/u/Baterka.xyz)\
**Post date:** [December 16, 2025, 1:49am UTC](https://forums.unrealengine.com/t/casting-entity-to-player-or-agent-fails/2672698/7 "2025-12-16T01:49:00Z")

</div>

Still persist in 39.10

---

<div class="post-metadata">

**Author:** ![BlackGolem](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@BlackGolem](https://forums.unrealengine.com/u/BlackGolem)\
**Post date:** [January 10, 2026, 9:16pm UTC](https://forums.unrealengine.com/t/casting-entity-to-player-or-agent-fails/2672698/9 "2026-01-10T21:16:57Z")

</div>

Still an issue as of v39.20

---

<div class="post-metadata">

**Author:** ![VovoRureima](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@VovoRureima](https://forums.unrealengine.com/u/VovoRureima)\
**Post date:** [February 25, 2026, 3:51pm UTC](https://forums.unrealengine.com/t/casting-entity-to-player-or-agent-fails/2672698/12 "2026-02-25T15:51:13Z")

</div>

Bug still persist on 39.50

---

<div class="post-metadata">

**Author:** ![lantram](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/lantram/32/977871_2.png) [@lantram](https://forums.unrealengine.com/u/lantram)\
**Post date:** [April 24, 2026, 8:24am UTC](https://forums.unrealengine.com/t/casting-entity-to-player-or-agent-fails/2672698/13 "2026-04-24T08:24:35Z")

</div>

Has this been fixed yet?

---

<div class="post-metadata">

**Author:** ![Abrizzer](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Abrizzer](https://forums.unrealengine.com/u/Abrizzer)\
**Post date:** [April 24, 2026, 11:54am UTC](https://forums.unrealengine.com/t/casting-entity-to-player-or-agent-fails/2672698/14 "2026-04-24T11:54:11Z")

</div>

Just checked on the scene I have to test this, and it’s still bugged, so you would need to do the for loop on the components and cast like the post [Casting Entity to Player or Agent Fails - #2 by AtAshTag](https://forums.unrealengine.com/t/casting-entity-to-player-or-agent-fails/2672698/2)

---

<div class="post-metadata">

**Author:** ![AtAshTag](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/atashtag/32/997253_2.png) [@AtAshTag](https://forums.unrealengine.com/u/AtAshTag)\
**Post date:** [April 24, 2026, 11:58am UTC](https://forums.unrealengine.com/t/casting-entity-to-player-or-agent-fails/2672698/15 "2026-04-24T11:58:29Z")

</div>

I do like this now

```auto
 EnteredEntity:entity := PlayerTriggerMesh.EntityEnteredEvent.Await()

        if:

            EnteredPlayer := EnteredEntity.GetPlayer[]

```

Put this in a util this is for player but obv you can modify

(Entity:entity).GetPlayer():player=

```auto
Result := for:

    Component: Entity.GetComponents()

    FortCharacter := fort_character[Component]

    Agent := FortCharacter.GetAgent[]

    Player:=player[Agent]

    Player.IsActive[]

do:

    Player

Result[0]

```

---

<div class="post-metadata">

**Author:** ![lantram](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/lantram/32/977871_2.png) [@lantram](https://forums.unrealengine.com/u/lantram)\
**Post date:** [April 24, 2026, 3:57pm UTC](https://forums.unrealengine.com/t/casting-entity-to-player-or-agent-fails/2672698/16 "2026-04-24T15:57:53Z")

</div>

@AtAshTag Thanks, that’s what I’m doing too. Just not super ideal. 😕

---

<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:** [May 6, 2026, 3:26pm UTC](https://forums.unrealengine.com/t/casting-entity-to-player-or-agent-fails/2672698/17 "2026-05-06T15:26:04Z")

</div>

This topic was automatically closed after 180 days. New replies are no longer allowed.

---

<div class="post-metadata">

**Author:** ![Bug-Reporter](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/bug-reporter/32/1223650_2.png) [@Bug-Reporter](https://forums.unrealengine.com/u/Bug-Reporter)\
**Post date:** [July 28, 2026, 12:01pm UTC](https://forums.unrealengine.com/t/casting-entity-to-player-or-agent-fails/2672698/19 "2026-07-28T12:01:24Z")

</div>

FORT-1033657 has been ‘Closed’. This is working as intended by design.
