Hello, im working with gui buttons and was wondering
what is the difference between
button.MouseButton1Click
and
button.Activated
pls respond. thanks
To clarify on what @VortexGamingPlayerYT said,
Button.Activated
is for when any platform activates the button, so if you are on mobile, and you tap it, it will still work. Button.MouseButton1Click
is just used for MouseButton1 clicks, or left mouse button clicks.
Just to clear up this misconception, MouseButton1Click
and Activated
both work on all devices. I know the name MouseButton1Click
can be misleading, but how do I know it works on phone/tablet? Simple, I joined my own game on mobile and tapped on a GUI. Even with MouseButton1Click
in the script of the GUI, it worked perfectly fine.
MouseButton1Click
and Activated
have only one difference that I know of. It's that Activated
allows inputObject
as a parameter. So you can use Activated
for whenever you want to do something with user input (which is very helpful).
Good question and I hope this helps!
(Edit: I know you've got different answers right now to your question. I will provide some links that might help:
Click the following links on Activated and MouseButton1Click
The difference between the 2 functions :
MouseButton1Click and .Activated
is that mousebutton1click
fires an event once a player has clicked a gui. But .Activated is .Activated is for tools once a player has clicked a tool then an event will fire .Activated is only used for tools while mousebutton 1click is only used for GUIs