void CheckPlatformBeneath(bool end) { if (end) { if (Physics.Raycast(transform.position, Vector3.down, out hit)) { if (hit.transform.tag != "End") { titleScreen.FailedChallenge(); index = 0; } else { hit.transform.gameObject.GetComponent <Renderer>().material.color = Color.green; titleScreen.CompletedChallenge(); index = 0; } } } }