Summary
.AddEntities()
when used to add any entity to any other entity (besides the World object entity in the Simulation Entity) causes the mesh component of the children entities to become invisible
Please select what you are reporting on:
Verse
What Type of Bug are you experiencing?
Verse
Steps to Reproduce
- Open any scene graph enabled project
- Add a bunch of entities into the world each with mesh components (with none of them parented to anything)
- Create and compile the dynamic_parent_component below then add it to any one of the entities that was just dropped in the scene.
- Launch a session
dynamic_parent_component
dynamic_parent_component<public> := class<final_super>(component):
var SimEntity : entity = entity{}
var WorldEntity : entity = entity{}
OnSimulate<override>()<suspends>:void =
Sleep(6.0) # Delay to allow for the loading screen to finish
if (S_E:= Entity.GetSimulationEntity[], W_E := S_E.GetEntities()[0]) {set SimEntity = S_E; set WorldEntity = W_E}
EveryOtherEntity := for (Ntt : WorldEntity.GetEntities(), Ntt <> Entity) do Ntt
Print("Parenting every other entity to self in 3 secs, they will disappear"); Sleep(3.0); Entity.AddEntities(EveryOtherEntity)
Print("Now Parenting every other entity to the World, they will reappear in 3 secs"); Sleep(3.0); WorldEntity.AddEntities(EveryOtherEntity)
Print("Parenting every other entity directly to the Simulation Entity, they will disappear once again"); Sleep(3.0); SimEntity.AddEntities(EveryOtherEntity)
Expected Result
No entity should disappear.
Observed Result
The entities disappear when added to the one bearing the dynamic_parent_component, then reappear when added to the World Entity (which is a child of the Sim Entity), then disappear once more when added directly to the Simulation Entity
Platform(s)
PC