private void OnCollisionEnter2D(Collision2D collision) { rigidbody.velocity = Vector3.zero; //waitTime = startWaitTime; if (collision.gameObject.layer == 8) { hitPlayer = true; //put player death in here //turn off player controls so they can't move, then fade in death screen collision.gameObject.GetComponent <PlayerController>().enabled = false; death.LoadDeathScene(); } }