Pointer Lock for Defold

Pointer Lock is intended to simplify mouse locking to access mouse events even when the cursor goes past the boundary of the window or screen. For example, a user can continue to rotate or manipulate a 3D model by moving the mouse without end. Without mouse locking, the rotation or manipulation stops the moment the pointer reaches the edge of the window or screen.

To sum up, if you want to make a first-person 3D game (DOOM-like, Quake-like etc.) with Defold, you need this extension.

Check out the web demo to test Pointer Lock on your desktop PC.

I wanted to join the latest LD49 and to make another one 3D FPS game with Defold. However, I didn’t come up with an idea. And instead of that, I made this asset based on DRILLER.

Enjoy!

Check the Github page to see what’s included and how to use the asset:

16 Likes

Useful stuff!

One key thing left is to make the *.dae to *.convesshape converter, and I’ll look for a way to clone myself to make a walking game :slight_smile:

3 Likes

Very nice!

2 Likes

Sweet! Thanks for sharing!

2 Likes

I’ve been looking for something like this! My own attempt at it resulted in some very janky cursor movement :upside_down_face:.

I made a converter a while ago but never published it. Now might be a good time to do that :eyes:.

4 Likes

Absolutely! I want to try this :slight_smile:

Really awesome! I downloaded the project and it works just fine on Linux here.

Am I right that this is all that was required for the non-web platforms? (!?!?)

static int Glfw_MouseLock(lua_State* L)
{
    glfwDisable(GLFW_MOUSE_CURSOR);
    return 0;
}
2 Likes

Yes!
:sweat_smile:

2 Likes

Thank you! I’ll update the Readme file.

3 Likes