Input.GetKeyUp Don't work to detect release of key

I have searched and seen several answers, but i cant get it to work. The code wont print the button up message, so i assume that i am missing something.


I am trying to make a function for Interaction and when you release the button it should confirm your choice of action. Similar to a weapon selection wheel.


Update

    void Update()
    {
        switch (isAiUnit)
        {
            case true:
                {
                    AiInput();
                }
                break;
            case false:
                {
                    PlayerInput();
                }
                break;
        }
    }

    void PlayerInput()
    {


        if(Input.GetKey(KeyCode.E))
        {
            if(Input.GetKeyDown(KeyCode.E))
            {
                interactionTimeStart = Time.time;
            }            
            InteractionInput(interactionTimeStart);

        }

    }

    void InteractionInput(float timeStart)
    {
        Debug.Log(" Button Down " + (Time.time - timeStart));
        if (Input.GetKeyUp(KeyCode.E) && ((Time.time - timeStart) > 0.25f))
        {
            Debug.Log(" ButtonUp ");
        }

    }

You are calling InteractionInput() from inside of the brackets around if(Input.GetKey()). On the frame that the button is released, however, Input.GetKey() will be false so InteractionInput() will never be called. You need to check for GetKeyUp outside of GetKey

In your check you are using & which is a bitwise operator, use && instead.