#Is authoring best practice?
1 messages · Page 1 of 1 (latest)
I'm asking to confirm, would it be a correct approach to create a prefab for every entity in my game, such as characters, enemies, buildings, and put an authoring script in it, thus spawning this prefab? I'm wondering how I should establish the relationship between Entity and GameObjects. For example, I will spawn an enemy and the enemy has certain components. How should I approach this situation? Also, which component should I use to render an entity?
I use authoring to create prefab entities and EM to create actual entities in batch, does it count as a bad practice? Hmm.
are you not making the actual entities in batch from an authored prefab?
I instantiate them using the prefab entity. I don't compose the entity archetype at runtime. Wait does the OP mean that? 🤔
that's how i took the question
but if it's not then yeah em is fine to instantiate prefabs
creating entities while baking is actually super awkward
how I should establish the relationship between Entity and GameObjects.
You don't establish any relationship between entity and gameobject. GameObjects inside a subscene are just a friendly way to prepare data for your ECS world. Think of them as temporary placeholder for your data, nothing more.
After a subscene is fully baked, it becomes a blob of native data, GameObjects don't live there and will all vanish.