|
How would I change a gameObject's material via scripting?
(comments are locked)
|
|
Use:
To change the texture to the material exposed in the inspector. For further material and texture documentation follow this link. That doesn't really change the material.
Jul 29 '10 at 12:38 AM
Magnus Wolffelt
What do you mean? It's from the docs.
Jul 29 '10 at 12:51 AM
e.bonneville
I guess it depends on what you mean by change. My understanding of the question was that the author wanted to exchange the material, not just modify it.
Jul 29 '10 at 09:38 AM
Magnus Wolffelt
I think he just wanted to have a different texture.
Jul 29 '10 at 11:33 AM
e.bonneville
Ya. thanks to both of you guys. sorry I didn't write my question clearly.
Jul 29 '10 at 06:01 PM
MikezNesh
(comments are locked)
|
|
First of all, a GameObject can't have a material. It can, however, have a Renderer, which has a Material: http://unity3d.com/support/documentation/ScriptReference/Renderer-material.html So basically:
(comments are locked)
|
