public void Reset() { var wasPushed = Pushed; Pushed = false; if (wasPushed) { var collider = GetComponent <BoxCollider>(); // check if the character is in the button if (!_characterIsInside) { _lerp.Lerp(_initialPosition + new Vector3(0f, -2f, 0f), _initialPosition, PhysicalButton.rotation, PhysicalButton.rotation, 1f); _canBePushed = true; } else { //Debug.Log("Character is in " + gameObject.name + " waiting for exit"); } } }