Info… Ok I know this has been asked lots before but I have been through many answers and can still can not wrap my head around it. I have a Gameobject called MAP and a script attached to it called Start.
This is the Start script…
var SpawnPoint = Vector3(50,234.5,391.1545);
var Block : Transform;
var BlockAmount : int = 0;
function Update ()
{
//Spawning of the first block
if (BlockAmount == 0)
{
Instantiate (Block, SpawnPoint, Quaternion.identity);
BlockAmount ++;
}
}
Question… Why does this script on my player not change the BlockAmount Var in the Start script?
This is my PlayerScript
var BlockAmount1 : GameObject;
function Start()
{
BlockAmount1 = GameObject.Find("MAP");
}
function Update ()
{
//When its grounded
if(transform.position.y <= 25)
{
BlockAmount1.GetComponent(Start).BlockAmount = 0;
}
}