Mouse Pointer Lock
This behavior removes the limit on the distance the mouse can move and hides the cursor.
Authors and contributors to this community extension: PANDAKO.
This behavior removes the limit on the distance the mouse can move and hides the cursor.
For example, a user can rotate or continue to manipulate an object by moving the mouse endlessly (open the project online). Without the pointer lock, the rotation or operation will stop the moment the pointer reaches the edge of the browser or screen.
Game players don't have to worry about leaving the gameplay area or accidentally clicking on another application that moves the mouse focus away from the game.
Locking the pointer locks CursorX()
and CursorY()
expressions.
Use MovementX()
and MovementY()
instead.
Tip
Learn how to install new extensions by following a step-by-step guide.
Actions
Exit pointer lock
Unlocks the mouse pointer and show it.
Request Pointer Lock
Lock the mouse pointer to hide it.
Conditions
Locked pointer is moving
Check if the locked pointer is moving.
Pointer is locked
Check if the mouse pointer is locked.
First person camera mouse mapper
Control camera rotations with a mouse.
Behavior actions
Horizontal rotation speed factor
Change the horizontal rotation speed factor of the object.
Z position offset
Change the z position offset of the object.
Maximum vertical camera angle
Change the maximum vertical camera angle of the object.
Minimum vertical camera angle
Change the minimum vertical camera angle of the object.
Vertical rotation speed factor
Change the vertical rotation speed factor of the object.
Behavior conditions
Horizontal rotation speed factor
Compare the horizontal rotation speed factor of the object.
Z position offset
Compare the z position offset of the object.
Maximum vertical camera angle
Compare the maximum vertical camera angle of the object.
Minimum vertical camera angle
Compare the minimum vertical camera angle of the object.
Vertical rotation speed factor
Compare the vertical rotation speed factor of the object.
Behavior expressions
Expression | Description | |
---|---|---|
Object.FirstPersonPointerMapper::HorizontalSpeed() |
Return the horizontal rotation speed factor of the object. | |
Object.FirstPersonPointerMapper::OffsetZ() |
Return the z position offset of the object. | |
Object.FirstPersonPointerMapper::VerticalAngleMax() |
Return the maximum vertical camera angle of the object. | |
Object.FirstPersonPointerMapper::VerticalAngleMin() |
Return the minimum vertical camera angle of the object. | |
Object.FirstPersonPointerMapper::VerticalSpeed() |
Return the vertical rotation speed factor of the object. |
This page is an auto-generated reference page about the Mouse Pointer Lock extension, made by the community of GDevelop, the open-source, cross-platform game engine designed for everyone. Learn more about all GDevelop community-made extensions here.