public void ClearTarget() { transform.root.gameObject.GetComponentInChildren <RewardShop>(true).gameObject.SetActive(false); dialoguePanel.SetActive(false); miniMapButton.GetComponent <Button>().interactable = true; transform.root.gameObject.GetComponentInChildren <CookingManager>(true).gameObject.SetActive(false); transform.root.gameObject.GetComponentInChildren <Store>(true).gameObject.SetActive(false); menuButtonImage.raycastTarget = true; StopCoroutine("CheckIfTargetLocked"); objectHit = null; targetHandler.AcquireTarget(null); targetHandler.AcquireTargetNPC(null); targetHandler.AcquireTargetOtherPlayer(null); targetCanvas.SetActive(false); // weaponButtonHandler.RegisterTarget(null); here too }