A prefab I made contains a Sphere gameobject. When I look at the prefab in the inspector the material for the sphere is grayed out and I can’t drop a texture on it.
After I instantiated the prefab in C# I want attach a material to this gameobject in c#.
Once I instantiate the material (in C#) what is the code (c#!) to then attach a material to the game object?
I’ve looked for some code samples but don’t see a consistent answer.
Thanks for any help.
(side questions, why is the material on the Sphere gameobject grayed out? If it is not there how does Unity know to show it? Is it a “public” variable of some sort that is part of the gameobject? The how did they get the complex UI for it? Is this just Unity knowing a sphere needs a material? sorry, rambling…)