It looks like you're new here. If you want to get involved, click one of these buttons!
So, I had this assignment from Unity Learn, and I couldn't find a way out of it. How do I change the material of a GameObject from within a script.
You need to access the MeshRenderer.material and set that to another material. Here is the documentation on mesh renderers: https://docs.unity3d.com/ScriptReference/MeshRenderer.html
Thanks. I'll get around if I need some other help regarding this topic.
Answers
You need to access the MeshRenderer.material and set that to another material. Here is the documentation on mesh renderers: https://docs.unity3d.com/ScriptReference/MeshRenderer.html
Thanks. I'll get around if I need some other help regarding this topic.