public void LaunchTrain() { isBroke = true; float offScreenRoll = Random.Range(0, 100); bool isOffscreenLaunch = offScreenRoll <= offScreenChance; if (gameController != null && sr != null) { gameController.HandleLostTrain(sr.sprite , isOffscreenLaunch , this.transform.position.x); } Vector2 randomForce = GetLaunchForce(isOffscreenLaunch); rotRate = Random.Range(launchRotRange.x, launchRotRange.y); this.gameObject.layer = 9; if (rb != null) { rb.AddForce(randomForce); } }