Hi i am trying to instantiate a prefab from the project which has some componentData attached to it,
What is the best way to instantiate a prefab without using any GameObject reference.
You can use
GameObjectConversionUtility.ConvertGameObjectHierarchy() to convert Gameobject Prefabs to Entity Prefabs (e.g. in
OnCreateManager())
and instantiate them with
EntityCommandBuffer.Instantiate().
@daschatten Thanks for your reply. So i have a prefab with hierarchy inside. so do i need to loop in through Gameobject prefab .or will this directly work.
It’ll work directly.
You can even put proxies in childs and it gets converted. Useful for moving/rotating parts.