private void LooseJoint(Joint2D joint) { GameManager gm = GameObject.FindGameObjectWithTag("GameManager").GetComponent<GameManager>(); if (joint.gameObject.name.Equals("Head") || joint.gameObject.name.Equals("Body")) { gm.SetWin(transform.parent.gameObject); gm.confettis.SetActive(true); } if (joint.GetComponent<CandiesEmitter>() != null) joint.GetComponent<CandiesEmitter>().EmitCandies(); Destroy(joint); // Tilt camera Camera.main.GetComponent<CameraManager>().TiltCamera(0.25f); }