I am trying to destroy a grid when a button is pressed. Each grid square is a child of one other one. This script is attached to the button.
#pragma strict
function OnMouseEnter ()
{
renderer.material.color = Color.red;
}
function OnMouseExit ()
{
renderer.material.color = Color.white;
}
function OnMouseUp ()
{
var grid = GameObject.FindWithTag("Grid");
renderer.enabled = false;
}
↧