#How do you make runtime instanced entities selectable in the SCENE VIEW?

1 messages · Page 1 of 1 (latest)

sick star
#

I am generating runtime entities via prefab instantiating but when I selected the entity, it selects the prefab (that lives in the world) instead of the entity that I clicked, is there anything I need to do to support thise use case?

honest apex
#

it should just work, does the entity exist in the same space as the prefab?

sick star
#

No, I am basically rendering a bunch of cubes from a prefab, but when I select one of the "new cubes" it selects all of them, and the inspector does not show me Entity Data, just prefab data. If I select it in the Entities Hierarchy it does work.

And in the Authoring component:

  CubePrefab= GetEntity(authoring.Prefab, TransformUsageFlags.WorldSpace | TransformUsageFlags.Renderable | TransformUsageFlags.Dynamic),

And inside a system

 for (int i = 0; i < 5000; i++)
            {
                var e = ecb.Instantiate(outpost.ValueRO.CubePrefab);
                ecb.AddComponent(e, new LocalTransform()
                {
                    Position = i * 5,
                    Rotation = quaternion.identity,
                    Scale = 1
                });
                ecb.SetName(e, $"Cube{i}");
            }