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
- Enable Scene Graph Experimental in the Project Settings,
- Copy the Scripts into a project
- Create a new entity and assign the component named Script1
- 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})