Quantcast
Channel: Answers for "Assigning variables to GameObjects"
Browsing all 6 articles
Browse latest 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

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

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 all 6 articles
Browse latest View live




Latest Images