void Update() { // If it's not null, get it's gameOver field, else log the error if (GM != null) { gameOver = GM.GetComponent <GameOver> ().gameOver; } else { Debug.Log("GM cannot be found!"); } // See it the position is below the threshold if (transform.position.y < destroyPoint) { // See if the snowflake is on the left or right side of the screen, which corresponds with each player's side if (transform.position.x > 0) { // If the snowflake spawned on the left, left player is ready if (gameObject.CompareTag("LeftSideSnowflake")) { // Change left side ready boolean to true readyText.SetLeftSideReady(); Debug.Log("Left Side Ready"); } // If the snowflake is on the right, add score to the left player and destroy snowflake GameObject.Destroy(this.gameObject); // if the game isn't over, add to the score if (!gameOver) { scoreText.AddScoreLeft(scoreValue); } } else { // If the snowflake spawned on the right, right player is ready if (gameObject.CompareTag("RightSideSnowflake")) { // Change right side ready boolean to true readyText.SetRightSideReady(); Debug.Log("Right Side Ready"); } // If the snowflake is on the left, add score to the right player and destroy snowflake GameObject.Destroy(this.gameObject); // if the game isn't over, add to the score if (!gameOver) { scoreText.AddScoreRight(scoreValue); } } } }