How can I get the Object class structure of the object the script is currently attached to? At the moment I have created a GameObject variable and assigned it to the same object in the object inspector, however, I would like skip this step. thanks, Richard. PS I am using this to destroy the object on a mouseDown event eg. Code (csharp): var myself : GameObject; function OnMouseDown () { Destroy (myself, 0.0); }
Destroy(gameObject, 0.0); A script inherits from MonoBehavior, and a MonoBehavior eventually inherits from Component, and a component is guaranteed to be attached to a gameObject. file:///Applications/Unity/Documentation/ScriptReference/Component.html#gameObject Cheers, -Jon