Destroy gameObject from a script not attached to it?

I have a menu screen where you click on a ball then it creates and larger ball to show you the one you selected. Then you click on another ball it creates the new large ball to show you what you selected.

I can’t seem to find the right code to destroy ball you previously clicked on… :frowning:

1 Answer

1

var snowball : Gameobject = GameObject.Find(snowball);
Destroy(snowball);

that would work, although this should be faster - Destroy(GameObject.Find(snowball));