Skip to content

Cursor

Updated

Custom mouse cursor image and pointer lock for mouselook.

Type
comp-cursor
Script class
CursorComponent
Per entity
One
Version
2.0.0

Read about it in Camera controllers: what it does, how to use it from a script, and examples.

The props the runtime declares for this component, with their defaults and accepted ranges.

Prop Default Range
hotspot
hotspot.0 0 ≤ x ≤ 127
hotspot.1 0 ≤ x ≤ 127

Run it in the browser, read its scripts, and download it as an XR Creator project.

#pragma lifecycle(startup)
function startup() {
const component = self.parent.getComponent(CursorComponent);
if (component) log(component.props);
}