- Home /
Cannot change material colour
Hi, I cannot change material colour of sphere, it's just grey-disabled. How can I enable it? Thanks in advance
Answer by vexe · Oct 06, 2013 at 08:35 AM
The Main Color
is disabled because your sphere doesn't have any material attached to it.
Create a Material (Right click inside your project view | Create | Material) and attach it to your sphere, now you can change the color via code:
sphere.renderer.material.color = Color.red;
Or via your inspector (the Main Color
variable that will be visible to you)
See this for more info (make sure you watch all the beginner series from Unity)
Perfect. Thanks a lot and sorry for my noob question. :)
@$$anonymous$$reibich: Don't forget to tick the answer as correct.
Answer by idbrii · Feb 14, 2018 at 06:28 PM
You can't edit the Material in the bottom of the editor when your object is using the default material.
To set another material:
expand the Mesh Renderer component
expand the Materials section
you can now see that Element 0 is Default-Material
click the target (circle on the right) to pick another material