Hi,
So I basically created a cube set it to a prefab and duplicated 2 others from it to do the same functions. I am trying to create a main menu having start game, exit and instructions/how to play. My problem is that when I try to make the objects do different things they all do the same thing. I thought it was the case of the prefab but I am not sure, I do not think it is because I tried redoing it without creating a prefab and the result was the same. After that I tried using the tag system but same result again. The result is that they all turn red, including the start object. Below is part of the code I am using(where I am having trouble), I did it so they change color when clicked on just to know that they are working as I want them to. I just started unity so I am a bit low on experience. If anyone can help I appreciate it. Thanks a lot in advance!
I have also tried the following and inserting start in the if statement:
var start : GameObject;
start = GameObject.Find("/Start");
function OnMouseUp()
{
if(GameObject.FindGameObjectWithTag("MenuItemExit"))
{
renderer.material.color = Color.red;
}
else(GameObject.FindGameObjectWithTag("MenuItemStart"))
{
renderer.material.color = Color.black;
}
}