Scene Graph: RemoveFromParent doesn't replicate to the client if the entity is a child of a prefab

Summary

When using Entity.RemoveFromParent() on an entity that is a child of a prefab, the removal isn’t happening within the game, but server state seems correct.

Please select what you are reporting on:

Unreal Editor for Fortnite

What Type of Bug are you experiencing?

Verse

Steps to Reproduce

  1. Create a custom component that removes its entity after some time
example_component := class<final_super>(component) {
	OnSimulate<override>()<suspends>: void ={
		Sleep(5.0)
		if (Parent := Entity.GetParent[]) {
			Print("Initial parent child count: {Parent.GetEntities().Length}")
			Entity.RemoveFromParent()
			Print("RemoveFromParent called, new parent child count: {Parent.GetEntities().Length}")
		}
	}
}
  1. Create a prefab containing a child entity with the custom component. Give it a mesh too

  2. Spawn the prefab to the world

using { /Fortnite.com/Devices }
using { /Verse.org/SceneGraph }
using { /Verse.org/Simulation }
using { /UnrealEngine.com/Temporary/SpatialMath }

example_device := class<final>(creative_device) {
	@editable TestButton: button_device = button_device{}

	OnBegin<override>()<suspends>: void ={
		TestButton.InteractedWithEvent.Await()

		NewEntity := Prefab_example{}
		NewEntity.SetGlobalTransform(FromTransform(TestButton.GetTransform()))
		if (SimulationEntity := GetSimulationEntity[]) {
			SimulationEntity.AddEntities(array{NewEntity})
		}
	}
}

Expected Result

The child entity removal should be replicated to players.

Observed Result

The entity is still visible to players after being removed. The server state seems correct: Parent.GetEntities().Length decreases, and the player can glitch through the mesh when walking into it.

Platform(s)

N/A (Desktop)

Video

Yeah, I run into that all the time. Especially big problem is the prefab spawned entities, they seem to have a different behavior.

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