ECS How to set an entity layer?

My game has a set of lights and each of them illuminates a different layer.
I’m using ECS in a specific part of the game, but all instantiated entities are being illuminated by the light that illuminates the default layer.
This means that the “entity is on the default layer”.
How can I change the layer of an entity?

1 Like

up

UP

(edit: sadly, not true as of the time of writing, thanks to @tertle for the correction, see below)

With hybrid rendering:

            entityManager.SetSharedComponentData<RenderMesh>(entity, new RenderMesh
            {
                mesh = theMesh,
                material = theMaterial,
                subMesh = 0,
                layer = 0, // Here
                castShadows = ShadowCastingMode.On,
                receiveShadows = true
            });
2 Likes

Pretty sure last time I checked RenderMesh layer is never used and is more of a placeholder for now unfortunately to the OP.

1 Like

(Replying to this kind of old thread because it still shows up as one of the first entries in google.)

I checked Florianhanke’s suggestion in version 2019.2.11f1, and it works as expected.

3 Likes

Is it possible to it now using burst?