void Awake() { posStart = transform.position.z; //We calculate the place of the beginning of the spawn of the road. cont = GameObject.Find("Players/Cylinder").GetComponent <CylinderCont>(); if (Finish != true) { float pos_1; float pos_2; pos_1 = thisHouse.localPosition.z + thisHouse.localScale.z / 2; pos_2 = nextHouse.localPosition.z - nextHouse.localScale.z / 2; distance = pos_2 - pos_1; } else { distance = 250; } }
void Start() { cylinder = GameObject.Find("Players/Cylinder").GetComponent <CylinderCont>(); sound = GameObject.Find("Finish").GetComponent <AudioSource>(); }
void Start() { cylinder = GameObject.Find("/Players/Cylinder").GetComponent <CylinderCont>(); }