Code Instantiates just fine and the object is placed perfectly, but it does not get set as child of helmNode. (returns the error at line 15)
What am I doing wrong here? Im sure its painfully obvious, just trying to learn the engine and Js
#pragma strict
private var helmMesh : GameObject;
var helmNode : Transform;
var helm : Transform;
function Start () {
}
function OnGUI()
{
if (GUI.Button (Rect (20,40,80,20), "EQUIP")) {
transform.Find("HELMEQUIP");
helmMesh = Instantiate(helm, helmNode.transform.position, Quaternion.identity) as GameObject;
helmMesh.transform.parent = helmNode.transform;
helmMesh.transform.rotation = new Quaternion (0, 0, 0, 0);
}
}
function Update () {
}