Back to Writing
NOTESunitymaterialsrenderingscripting
Unity Material Scripting: Handling Multiple Materials
September 18, 2019•Updated Feb 17, 2026

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:
