#Entity creation inside/outside subscene

1 messages · Page 1 of 1 (latest)

dapper kettle
#

Hello. I'm a bit confused about entity creation and how it relates to subscenes.
I have a System (will be attached) that creates a chunk entity (gets created outside of the subscene), tries to set it's parent to a chunkworld entity that's already in the subscene (which doesnt work), creates a couple block entities (also created outside the subscene) and sets their parent to the chunk entity (which works). Then in the Job it makes 6 more face entities per block, however these entities are created within the subscene. The commented out line after sets the faces' parents to their respective blocks, and that works, taking them out of the subscene. It's commented out for demonstration.
My questions are:
Why are Entities created early in the system created outside of the subscene, while ones created in the job are created within?
How would I make sure entities created earlier get created in the subscene so I can parent them properly?
As always any help is appreciated.

system and screenshots are attached

sullen juniper
#

Why are Entities created early in the system created outside of the subscene, while ones created in the job are created within?

The face prefab (presumably 53:1 in your screenshot) is baked into the subscene from which you're referencing it via the chunk world entity. Instantiating it copies over the SceneTag/SceneSection shared components which identify the subscene the entities came from. Entities created from scratch lack this information and are thus placed outside any given subscene in the Entities Hierarchy view.

How would I make sure entities created earlier get created in the subscene so I can parent them properly?

You could grab the SceneTag and SceneSection values from the chunk world entity and add those to the created entities.

dapper kettle