i need to destroy prefab clones

u can apply this script to ur camera

#pragma strict

var item1 : GameObject;
var item2 : GameObject;
var item3 : GameObject;
var Item;

var dropcount = 0;

function Update() 
{
	if(dropcount == 1)
	{
		Item = item1;
	}
	if(dropcount == 2)
	{
		Item = item2;
	}
	if(dropcount == 3)
	{
		Item = item3;
	}
}

function OnGUI()
{
	if(GUI.Button(Rect(250, 250, 100, 50), "Destroy"))
	{
		Destroy(Item); 
	}
	if(GUI.Button(Rect(250, 200, 100, 50), "Spawn"))
	{
		Instantiate(Item);
	}
	if(GUI.Button(Rect(200, 150, 50, 50), "1"))
	{
		dropcount = 1;
	}
	if(GUI.Button(Rect(200, 200, 50, 50), "2"))
	{
		dropcount = 2;
	}
	if(GUI.Button(Rect(200, 250, 50, 50), "3"))
	{
		dropcount = 3;
	}
}

I think you should put that instead of Destroy(Item);

Destroy(GameObject.Find(item.name + " (Clone)"));

Also you can’t destroy a prefab so it should give an error :slight_smile: