Quantcast
Channel: Answers for "Accessing another script from a class"
Browsing latest articles
Browse All 6 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
Browsing latest articles
Browse All 6 View Live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>