Source: Roblox Creator Hub · CC BY 4.0 · View source · Code samples: MIT Imported 2026-10-03. Formatting adapted for this site.
MouseBehavior
Used with the UserInputService.MouseBehavior property of UserInputService to set how the user's mouse behaves.
Items
| Name | Value | Description |
|---|---|---|
| Default | 0 | The mouse moves freely around the user's screen. |
| LockCenter | 1 | The mouse is locked and cannot move from the center of the user's screen. |
| LockCurrentPosition | 2 | The mouse is locked and cannot move from its current position on the user's screen at the time of locking. |
Default
The mouse moves freely around the user's screen.
| Field | Value |
|---|---|
| value | 0 |
LockCenter
The mouse is locked and cannot move from the center of the user's screen.
| Field | Value |
|---|---|
| value | 1 |
LockCurrentPosition
The mouse is locked and cannot move from its current position on the user's screen at the time of locking.
| Field | Value |
|---|---|
| value | 2 |