MouseButton1Down Fires on ButtonA UP on Controller instead of DOWN

Nevermind I’ve been working on controllers stuff for so long I am losing my mind. There is no bug.


I have a ImageButton that I am binding like this:

t.MouseButton1Click:connect(function() print("Buy product: " .. t.ItemName.Text) end)

When a controller is connected the event should fire on ButtonA DOWN

Instead it fires on ButtonA UP

I think the best fix is to create a new event ImageButton.Clicked. For PC it should fire on mouse button down. For controller it should fire on ButtonA down. For mobile it should fire on tap. Also the legacy behavior should be fixed because it says down but is really up for controllers.

1 Like

AFAIK, MouseButton1Click doesn’t fire when the mouse is down on either mobile, console or PC. Hence the name “Click”, it fires when the mouse is in bounds and the click is released.

Edit: Just noticed that the title doesn’t align with the example. Try using Button.InputBegan and checking if the UserInputType is MouseButton1.

2 Likes

Your example is using MouseButton1Click, not MouseButton1Down

EDIT: I hate the reply system

2 Likes

Just tested this and you are right.

If I use MBDown it works the way I would like it to.

1 Like