Quantcast
Channel: Answers for "Accessing another script from a class"
Browsing all 6 articles
Browse latest View live

Answer by efge

You could use the function GetComponent. Look at the example in the reference.

View Article



Answer by Jessy

You just need a reference to the instance script1.http://unity3d.com/support/documentation/ScriptReference/index.Accessing_Other_Game_Objects.htmlFor example:private var x; public function SetX (x) {...

View Article

Answer by Winston

I have found the answer. The reference link I needed to use was:var Script1script = gameObject.GetComponent("script1"); Script1script.SetX(1); Thanks for the help.

View Article

Answer by efge

You could use the function GetComponent. Look at the example in the reference.

View Article

Answer by Jessy

You just need a reference to the instance script1.http://unity3d.com/support/documentation/ScriptReference/index.Accessing_Other_Game_Objects.htmlFor example:private var x; public function SetX (x) {...

View Article


Answer by Winston

I have found the answer. The reference link I needed to use was:var Script1script = gameObject.GetComponent("script1"); Script1script.SetX(1); Thanks for the help.

View Article
Browsing all 6 articles
Browse latest View live




Latest Images