PcoWSkbVqDnWTu_dm2ix
The Developer Hub is now deprecated and information on this page may no longer be accurate. To see our new and improved documentation, please click here. You can read more about the future of documentation here.
Collapse Sidebar

Button1Up

Fires when the left mouse button is released.

For information on how to obtain the Mouse object, please see the Mouse page.

Developers can find out the position of the mouse in world-space, and if it is pointing at any BasePart using the Mouse/Hit and Mouse/Target properties.

Note, developers are recommended to use UserInputService instead of the Mouse object in new work.


Code Samples


Color Randomizer Tool (Button1Up)

The follow example changes the BasePart/BrickColor of every BasePart the player clicks and releases their mouse on.

In order for a part to change color, the player’s mouse must be over the part both when the player presses their left mouse button down and when the player releases their left mouse button.