Hi! I’m a newbie in Unity and I want to make a simple menu script,i have watched/read some tutorials, but i don’t understand what the problem is. Here is the code:
using UnityEngine;
using System.Collections;
public class Menu_Exit : MonoBehaviour
{
void OnMouseEnter()
{
renderer.material.color = Color.green;
}
void OnMouseExit()
{
renderer.material.color = Color.black;
}
void OnMouseDown()
{
Application.Quit();
}
}
When i start the application, nothing works. No color change, the application doesn’t closes and I dont know why. Please help me
Thanks!