Answer the question
In order to leave comments, you need to log in
Connecting a script in Unity3d?
I started mastering Unity3d using the lessons offered on unity3d.com. Faced the following problem. (I just want to refer from one script to another.)
There is a Cube object on the stage, the "MainCube" javascript is attached to it:
#pragma strict
public var otherObject: GameObject;
private var printH: PrintH;
function Awake(){
printH = otherObject.GetComponent(PrintH);
}
function Start(){
Debug.Log(printH.text);
}
#pragma strict
public var text: String = "Hi, World!!!";
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question