Hi
I am new to unity.
I am trying to change the color of my object, and I want to assign it to a button, so when I click the button, color changes to the specific RGB that I enter manually.
I have searched but didn’t get what I need. can anyone help ?
ok. then you can change the color (by defining rgba values) of the object as follows:
Color myColor = new Color(r,g,b,a);
Transform parentObject = this.transform.parent;
if(myButtonClicked == true){
parentObject.renderer.material.color = myColor;
}
Oh, btw, don’t use plane. It has 100 tris. Not necessary for a measly button. Use Quads. Only 2 tries. 