var FirstPlot: GameObject;
if ( Input.GetMouseButtonDown (0)){
var hit: RaycastHit;
var ray: Ray = Camera.main.ScreenPointToRay(Input.mousePosition);
if (Physics.Raycast(ray, hit)) {
if(hit.collider.tag=="Respawn")
{
Destroy(FirstPlot);
}
}
}
Whats wrong, no errors are given out and yet the Cube isn't being destroyed?
Thanks
↧