private void OnTriggerEnter2D(Collider2D collision) { if (collision.CompareTag("exit")) { GetComponent <Joint2D>().enabled = true; GetComponent <Joint2D>().connectedBody = collision.attachedRigidbody; musicSource.Stop(); musicSource.clip = winMusic; musicSource.Play(); Debug.Log("Won"); gs.Win(); } }