void FixedUpdate() { if (!gameStarter.isReady) { return; } if (gameEnd) { this.GetComponent <MonsterAI>().enabled = false; } if (transform.position.x >= gameCharacter.transform.position.x - 3) { gameStarter.FinshGame(); gameEnd = true; StopCoroutine(CoMonsterSpeedUp()); } }