Search Issue Tracker
By Design
Votes
1
Found in
5.0.0b18
Issue ID
661506
Regression
Yes
[Materials] Unable to override materials on objects with .materials[]
Steps to reproduce:
1. Open the attached project and the scene
2. There is a script attached to a cube which should change every material to a defined custom material by pressing the 'Z' key
3. Press the 'Z' key, observe that nothing happens. meshRend.materials [i] = mat; is executed for every material, no change
4. Press the 'X' key. It executes meshRend.material = mat; and changes the main material successfully
Comments (1)
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- var VisionOSEDRHeadromm has a comma instead of a dot when building with Metal Rendering App Mode and local OS localization is set to German
- IAP Catalog remove product “x” and add product “+” buttons are not consistent with other remove and add buttons in the Editor
- Performance issues in Play Mode when quickly hovering the mouse cursor over Hierarchy GameObjects
- Frame Debugger displays incorrect output when FidelityFX Super Resolution or Spatial-Temporal Upscaler is used with Temporal Anti-aliasing or Subpixel Morphological Anti-aliasing
- Crash with “Fatal Error! The file ‘MemoryStream’ is corrupted!” when adding a large number in Font Character Rects Size field
Aras
Sep 18, 2015 11:22
By design; "meshRend.materials [i] = mat" code only modifies locally returned copy of the array. Need to assign the modified array back to the renderer to take effect.