Setting material on render component #6895
-
When material is set on a render component of type asset, its is being ignored by mesh instances. What is the reason for this? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
This is the way it was done on the model component a long time ago, and render component uses it the same way. This is only used for built-in shapes, I assume to simplify access to I agree it's not a great API, and one day we should probably just remove it / replace by |
Beta Was this translation helpful? Give feedback.
This is the way it was done on the model component a long time ago, and render component uses it the same way.
This is only used for built-in shapes, I assume to simplify access to
meshInstances[0].material
. Asset can have multiple mesh instances, so a single material does not make sense. Especially a getter would not work in that case.I agree it's not a great API, and one day we should probably just remove it / replace by
setMaterial(index, material)
andgetMaterial(index)