How to get an instance in instancedMesh by index

I’d like to change the opacity of some of some of the instances in an instancedMesh by their indices.

Seems instancedMeshes[i].opacity = 0.1 will throw an error:
Uncaught TypeError: instancedMeshes[i] is undefined

In the official doc, there is only the method to change material color by instance index, such as: instancedMeshes.setColorAt(i, highlightColor);

But it’s not mentioned on how to change other properties of the material assigned to individual instances.

You can’t assigned individual materials to instances. There is only a single material for all instances of InstancedMesh.

1 Like