private void OnMouseDown() { joystick.SetActive(true); joybutton.SetActive(true); foreach (GameObject go in players) { go.GetComponent <Movement>().enabled = false; go.GetComponent <BoxCollider2D>().isTrigger = true; } GetComponent <Movement>().enabled = true; _objectCollider.isTrigger = false; }