public void CancelGoToPointInteraction() { playerStats.CancelRunAnimation(); if (toPointGameObject.CompareTag("ItemNeeded")) { ItemNeeded itemNeeded = toPointGameObject.GetComponent <ItemNeeded> (); itemNeeded.moveToClosePosition = false; playerStats.goingToPoint = false; } if (toPointGameObject.CompareTag("Observation")) { Observation observation = toPointGameObject.GetComponent <Observation> (); observation.moveToClosePosition = false; playerStats.goingToPoint = false; } }