GuiButton.MouseButton1Click vs GuiButton.Activated, whats the difference?

Hello! A former developer of mine uses GuiButton.Activated for GuiButtons, while I use MouseButton1Click.

Is there really a difference to using one or the other?

I mean… They have the same functionality, right?

If you see something different with one, please let me know. Thanks, WE

1 Like

They mostly have the same functionality, but Activated has an extra feature that allows you to see how many times a button was pressed, in a row.

4 Likes

GuiButton.MouseButton1Click only works for PC whereas GuiButton.Activated works for PC and mobile, very versatile.

MouseButton1Click works for all platforms. That is false.

1 Like

It doesn’t mention cross-platform input.

Well, I playtest my game on mobile, and it works all the time.

1 Like

Yup, it works for mobile my mistake. That’s strange how it’s called “MouseButton1Click”.

1 Like

My last question is, which one is less laggy?

Both are probably the same in performance. I don’t understand why these events would cause any lag at all?

2 Likes

I know I’m late but, mousebutton1click does work for mobile, BUT it doesn’t work for mobile in surfaceGUIs so if you’re using surfaceGUI’s, use Activated so both mobile and pc can click it.

2 Likes

From what I know theres 1 useful difference between them. If you use .Activated as an event listener then the function wont run IF the button is deactivated and clicked on. Whereas using the MouseButton1Click event listener will always run regardless of wether the button is Active or not if the player clicks on it.

Screenshot 2024-12-20 at 06.10.03

1 Like

Since this thread was bumped, I’d like to bring up another key difference that no one else here has mentioned so far:


For the Activated event:

  • The first parameter returns the InputObject that was used to activate the button

    (*The second parameter it returns is what the currently marked solution has mentioned, being how many times the button was clicked in a row).

    The InputObject Can be referenced to easily check a variety of things, including the UserInputType (such as MouseButton1, Touch, Gamepad1 , etc.).


Aside from that, here’s what I wrote a while back regarding which I prefer to use:

1 Like