Can you use GetMouseButtonDown, GetMouseButton, GetMouseButtonUp as 3 different actions?

Hi guys,
I’m testing if I’m able to get 3 actions off one input of a mouse click & hold, so far it looks like GetMouseButton overrides GetMouseButtonDown, as it doesn’t print “Bunt!” ever

    private void Update()
    {       
        if (Input.GetButtonDown("Fire1"))
        {
            Debug.Log("bunt");
        }

        if (Input.GetButton("Fire1"))
        {
            Debug.Log("Choose action!");
        }

        else if (Input.GetButtonUp("Fire1"))
        {
            Debug.Log("Action!");
        }

For the sake of this it’ll eventually lead to an animation playing > a radial menu opening after animation > and whatever the cursor is hovering over is the action that takes place

To me this seems like 3 separate actions but if this can be interpreted in a different way that I could look into that’d be greatly appreciated.

Cheers

GetButton cannot override GetButtonDown; they’re two separate methods.
What you have here should be working just fine.

Are you sure you don’t see the “bunt” message only because the console quickly gets flooded with “Choose Action!” every frame?
Try enabling the collapse option in the console window so that duplicate messages don’t get displayed, if it isn’t already.

3 Likes

Oh I see, the collapse matches with what you said, so that’s all good. So in theory what I’m tryna do with this radial menu thing should work, appreciate it!