Adding a Scene Graph Entity with Interact and Transform Components Crashes the server

Summary

I was trying to learn how to spawn entities from a different entity and whenever I instanced a new entity with a custom verse component that would then add a Transform Component and a interactable component it would freeze and crash the server

Please select what you are reporting on:

Verse

What Type of Bug are you experiencing?

Verse

Steps to Reproduce

  1. Enable Scene Graph Experimental in the Project Settings,
  2. Copy the Scripts into a project
  3. Create a new entity and assign the component named Script1
  4. Inside the game Interact with the entity and the server should freeze and crash

Expected Result

The Entity gets generated correctly with the specified components

Observed Result

When Interacted with the entity instead of making a new one the server crashes

Platform(s)

windows

Video

Additional Notes

The session ID from the session in the video:
fb07bf01c1614f9880683c3c88dab4d3

Script 1

using { /Verse.org }
using { /Verse.org/Native }
using { /Verse.org/Simulation }
using { /UnrealEngine.com/Temporary/SceneGraph }
using { /Fortnite.com/Playspaces }
using { /Fortnite.com/Devices }
using { /Fortnite.com/Game }

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

    
  
    # Runs when the component should start simulating in a running game.
    OnBeginSimulation<override>():void =
        # Run OnBeginSimulation from the parent class before
        # running this component's OnBeginSimulation logic
        (super:)OnBeginSimulation()

        # TODO: Place logic to run when the component starts simulating here
        Print("OnBeginSimulation")

    # Runs when the component should start simulating in a running game.
    # Can be suspended throughout the lifetime of the component. Suspensions
    # will be automatically cancelled when the component is disposed or the
    # game ends.
    OnSimulate<override>()<suspends>:void =
        # TODO: Place simple suspends logic to run for this component here
        Print("OnSimulate")
        if(RoundStart:=Entity.GetFortRoundManager[]):
            RoundStart.SubscribeRoundStarted(OnRoundStarted)


    OnRoundStarted()<suspends>:void=
        MyComponent : interactable_component = interactable_component{Entity:=Entity}
        Entity.AddComponents(array{MyComponent})
        MyComponent.SucceededEvent.Subscribe(GenerateOne)


    GenerateOne(Agent:agent):void=
        NewEntity:=entity{}
        NewEntity.AddComponents(array{Script2{Entity:=NewEntity}})
        Entity.AddEntities(array{NewEntity})

Script2

using { /Verse.org }
using { /Verse.org/Native }
using { /Verse.org/Simulation }
using { /UnrealEngine.com/Temporary/SceneGraph }
using { /Fortnite.com/Playspaces }
using { /Fortnite.com/Devices }
using { /Fortnite.com/Game }
using { /Fortnite.com/Characters }

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


    # Runs when the component should start simulating in a running game.
    OnBeginSimulation<override>():void =
        # Run OnBeginSimulation from the parent class before
        # running this component's OnBeginSimulation logic
        (super:)OnBeginSimulation()

        # TODO: Place logic to run when the component starts simulating here
        Print("OnBeginSimulation")

    # Runs when the component should start simulating in a running game.
    # Can be suspended throughout the lifetime of the component. Suspensions
    # will be automatically cancelled when the component is disposed or the
    # game ends.
    OnSimulate<override>()<suspends>:void =
        # TODO: Place simple suspends logic to run for this component here
        Print("OnSimulate")
        InteractableComponent : interactable_component = interactable_component{Entity:=Entity}
        TransformComponent: transform_component = transform_component{Entity:=Entity}
        Entity.AddComponents(array{InteractableComponent,TransformComponent})

Project Files: BuggedProject.zip (174.0 KB)

Also In script2 if one of the Components are removed it will work just fine

Also this works, by just splitting the components into a singular array each and calling AddComponents seperately for each one

Thank you for the detail here, we’ll get someone to take a look.

FORT-861880 has been created and its status is ‘Unconfirmed’. This is now in a queue to be reproduced and confirmed.

The above is a duplicate of FORT-831483, which will be addressed in 34.00. Thank you so much for the report!

1 Like