Touch Menu problem

I’m trying to create a touch menu but I don’t know which variable is the correct for the iOS. I’ve tried with OnMouseEnter but the Unity prints: There is no ‘Renderer’ attached to the “no” game object, but a script is trying to access it.

function OnMouseEnter ()
{
	renderer.material.color = Color.red;
}

Any ideas? Thanks.

I’m guessing this is C#. But I have similar code, but the function needs to return void AND be imbedded into the Update() function. Check out this code that will allow another scene to be loaded.

public class MenuObject : MonoBehaviour 
{
	public bool isQuit = false;
	public int modelToLoad = 0;
	void OnMouseEnter()
	{
		renderer.material.color = Color.red;		
	}
	
	void OnMouseExit()
	{
		renderer.material.color = Color.white;
	}
	
	void OnMouseDown()
	{
		if(isQuit)
		{
			Application.Quit();
		}
		else
		{
			renderer.material.color = Color.blue;
			Application.LoadLevel(modelToLoad);
		}
		
	}
}

I am not sure why you guys are using mouse commands. They do not work with touch iOS. look up Input.Touch or Input.GetTouches.

Mouse Input actually does work with on iOS.

How so?

The mouse input is just calculated from the first touch on the screen.

Thanks for catching that renman3000 and Astrauk.

But if you use Mouse Input (what is the exact function call?), you cannot do multi-touch, correct? It just converts the touch to mouse click then ignores any other touches, right?

it will take the avrage point between touches if your not using multi touch.