Documentation

Support

Unity Studio

Open Unity Studio

Unity Studio

Cursor node

Access options for the cursor.
Read time 1 minuteLast updated 17 hours ago

The Cursor node allows you to show or hide the cursor and lock it to the center of the screen or within the application window. This is useful for applications that require mouse lock or when you want to hide the cursor during scenes or while the app runs.

Variables

Expand the node to view available variables you can use with the Cursor node:

Variable

Type

Description

visible
bool
Use to return or control whether the cursor is visible. Set this to true to show the cursor or false to hide it.
lockState
CursorLockMode
Use to return or control the lock state of the cursor. You can set it to one of the following:
- None: The cursor behaves like default and can move freely.
- Locked: Lock the cursor to the center of the screen and make it unable to move.
- Confined: Ensure the cursor can't move outside the application window but can move within it.

Methods

Expand the node to view available methods you can use with the Cursor node:

Method

Return type

Description

To string
string
Returns a string representation of the Cursor's current state, including its visibility and lock state. This can be useful to debug and understand how the cursor is currently configured in your game.

Additional resources