Properly Assign Material to Instantiated Entity in "Hybrid Renderer V2"

Hi, I’m experimenting with “Hybrid Renderer V2” and am not sure what the correct way of converting a material is.

I should also note that my meshes are created dynamically at runtime, which is why I’m not just using the converter.

In version 1 I would simply do this

RenderMesh renderMesh = new RenderMesh() { mesh = mesh, material = basicMaterial };

and the “basicMaterial” material would properly appear. In the entity inspector it looks like this:
7924669--1011586--upload_2022-2-24_16-7-12.png

In “Hybrid Renderer V2” my cubes are now gray.
I have noticed that the “Convert to Entity” script gets the job done, but adds a million components XD.

Does anyone know if there’s a good way of approaching this data-component-catastrophe?

Thanks! :slight_smile:

7924669--1011589--upload_2022-2-24_16-7-44.png

Just adding the render mesh component is not enough, see Runtime entity creation | Hybrid Renderer | 0.11.0-preview.44 for how to properly create them during runtime.

1 Like

Thank you very much, that’s docs page is exactly what I’ve been looking for :slight_smile: