Back to Writing
NOTESunitymaterialsrenderingscripting

Unity Material Scripting: Handling Multiple Materials

September 18, 2019Updated Feb 17, 2026

![](

e2DQg.Pzv7K-l6Qc5UNLFrK8YlurWMWKdiazQFsRr9_R5calEg.JPEG.cdw0424/photo-1534972195531-d756b9bfa9f2.jpg?type=w966)

When dealing with multiple materials, you should use renderer.materials (plural) instead of renderer.material. Cache the materials array, access by index, modify, then reassign back to the renderer.

See the reference blog below.

Reference:

Post image

How to Change Materials via Script