Hi, I'm a script in JS and I want to get the reference to my own gameobject so that i can do this: abc = gameObject.AddComponent("AbcScript");
Is it possible?
asked Aug 19 '12 at 07:38 PM
That's correct: gameObject alone is a reference to the object to which the script is attached, thus you will add AbcScript to it and get a reference to the script in abc. The same applies to transform, renderer, collider etc.
answered Aug 19 '12 at 07:47 PM