Hi! I have this game component called “gui_Stage01” (it’s not a gui texture, don’t ask) and it has a child called “BossSelectFrame01”.
What I want to do is to change the material of the child on mouse entry.
This is what I got:
void OnMouseEnter()
{
if (gameObject.name == "gui_Stage01")
{
audio.Play();
transform.FindChild("BossSelectFrame01").renderer.material.name = "mat_BossFrameOn";
}
}
However, that only changes the name of the material, not the material itself.
Can someone please help me