I have been going through the official roblox scripting courses to learn and/or get a better grip on everything I need to know. Having followed the ‘Interactive Buttons’ tutorial (Interactive Buttons) exactly, as far as I know, my function to print “Button Activated!” is not firing.
The local script is a direct child of the button,
and the code is directly copied from the article.
local button = script.Parent
local function onButtonActivated()
What could the problem be? Or is the tutorial somehow outdated/missing something?
Activated fires when the user performs the primary action of the button. Its primary purpose is a cross-platform, general input event for buttons.
For pointer-based platforms with a mouse, this fires after the mouse button is pressed then released while hovering over the UI element.
For gamepad input, the event fires when the GuiService.SelectedObject is equal to the UI element and the primary gamepad button is pressed then released.
For touch input, the event fires when the user touches and releases the UI element.
Although direct input events like GuiObject/MouseButton1Down or GuiObject.InputEnded aren’t deprecated and may still function as you might expect, it is better practice to use this event for general button input instead.