private void HandleDisplaySign() { if (Time.time - eatStartTime > eatCooldown) { eatStartTime = Time.time; closestMushroom = null; float minDist = 1000; GameObject[] mushrooms = GameObject.FindGameObjectsWithTag("Mushroom"); foreach (var mushroom in mushrooms) { float distance = (mushroom.transform.position - transform.position + eatOffset).magnitude; Mushroom mushroomComponent = mushroom.GetComponent <Mushroom>(); if (mushroomComponent && mushroomComponent.isConsumable() && distance < eatRadius) { if (distance < minDist) { closestMushroom = mushroom; minDist = distance; } } } } eatSign.SetActive(false); if (closestMushroom) { eatSign.transform.position = closestMushroom.transform.position; eatSign.SetActive(true); } }