Quantcast
Channel: Answers for "Assigning variables to GameObjects"
Browsing latest articles
Browse All 6 View Live

Answer by Piflik

You cannot access private variables directly from other scripts at all. You would need getter/setter functions... Public variables can be accessed by: gameObject.GetComponent(ScriptName).VariableName;...

View Article



Answer by jogo13

You'll have to do it via attached script classes (which can be attached as 'components.') Even the basic Gameobject is class that is a collection of other classes and structs (such as transform.)...

View Article
Browsing latest articles
Browse All 6 View Live




Latest Images

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