Exemple #1
0
 //method which spawn new block when the distance is more than required
 void CheckForY()
 {
     cameraY = transform.position.y;
     if (Mathf.Abs(cameraY - lastCameraY) > 3.1f)
     {//reset the lastCameraY position
         lastCameraY = cameraY;
         //call the method from the blockspawner script
         blockSpawner.SpawnBlock();
     }
 }