'How to change game object Material in Unity?
How can I do if cube1 collision cube2, cube1 material = yesil ? I'm new in Unity and English speaking sorry about that :)
Solution 1:[1]
You are changing the material of the Mesh Renderer component of the game object. Hence, get a reference to the Mesh Renderer and change its material.
red.GetComponent<MeshRenderer>().material = yesil;
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Geeky Quentin |