Scenegraph - Player loses possessable component if they are eliminated/respawn

Summary

The fort character loses the possessable component if they are eliminated/respawn meaning we can’t query the agent from hit events anymore.

The player also doesn’t seem to always get a possessable component on the first spawn, but I couldn’t get an easy repro on this - they do get one most of the time on first spawn during my testing.

Test players sometimes don’t get a possessable component at all (not sure if they’re different)

Please select what you are reporting on:

Unreal Editor for Fortnite

What Type of Bug are you experiencing?

Scene Graph

Steps to Reproduce

  1. Query possessable component
  2. Respawn
  3. Try and find it again
using { /Verse.org/Native }
using { /Verse.org/SceneGraph }
using { /Verse.org/Simulation }
using { /Verse.org/Input }
using { /Verse.org/Input/UI }
using { /Fortnite.com/Devices }
using { /Verse.org/Assets }
using { /UnrealEngine.com/Temporary/UI }
using { /Fortnite.com/Characters }
using { /Fortnite.com/Animation/PlayAnimation }

test_poss_component<public> := class<final_super>(component):

    @editable Trigger : trigger_device = trigger_device{}


    TriggerAwait()<suspends>:void=
        loop:
            mAgent:=Trigger.TriggeredEvent.Await()
            if:
                Agent:=mAgent?
                FC:=Agent.GetFortCharacter[].GetEntity[]
                PossComp := first(Comp : FC.FindDescendantComponents(possessable_component)). Comp 
            then:
                Print("Poss Comp found!")

    OnBeginSimulation<override>():void =
        (super:)OnBeginSimulation()

    OnSimulate<override>()<suspends>:void =
        spawn. TriggerAwait()
        

### Expected Result
Possessable component is readded on respawn/elimination

### Observed Result
The component is missing

### Platform(s)
All

### Video

Thanks for reporting this. This will be fixed in 42.00!

1 Like

Appreciate you, thanks :slight_smile:

FORT-1124797 is ‘Closed’ as ‘Fixed’. The issue will be addressed in 42.00.

using. /Fortnite.com/Characters

using. /Fortnite.com/Playspaces

using. /Verse.org/SceneGraph

using. /Verse.org/Simulation




possessable_component2<public> := class<final_super>(component) {

    @editable

    Agent<public>: ?agent = false;

}




# 


stupid_workaround_component<public> := class<final_super>(component) {

    OnSimulate<override>()<suspends>: void = {

        if (Playspace := Entity.GetPlayspaceForEntity[]):

            loop:

                for (

                    Agent: Playspace.GetParticipants();

                    FCE := Agent.GetFortCharacter[].GetEntity[];

                    not (FCE.GetComponent[possessable_component2].Agent? = Agent);

                ) {

                    FCE.AddComponents(array. possessable_component2:

                        Entity := FCE;

                        Agent := option. Agent;

                    );

                }

                Sleep(0.0);

    }

}

workaround worked for my usecase