okay that worked, i only forgot one thing to implement, and that is that i have to be able to click the object itself and not anywhere in the scene xD just found that out
Why not just declare your variable as a game object instead of a transform – var cube : GameObject; – and save yourself from drilling through the hierarchy? Not a big deal, just a little less code. You could then just use the script you wrote in the first post above. Destroy (cube);