So I have a game controller object that controls everything. And within that script I have something like this:
var Player: GameObject;
var node : GameObject;
function Start()
{
Instantiate(Player, transform.Vector3(0, 0, 0), Quaternion.identity);
Instantiate(node, transform.Vector3(0, 0, 0), Quaternion.identity);
Player.setStartNode(node);
}
and then in the Player script (which is attached to a prefab named Soldier) I have the following code.
var node : GameObject;
function setStartNode(startNode : GameObject)
{
this.node = startNode;
}
But the problem I get is: 'setStartNode' is not a member of 'UnityEngine.GameObject'.
I kind of understand what is happening, but I can't really figure out how to fix this. I'm a little new to Unity scripting.