First person controller

Simple first-person camera with dynamic collider.

29 Likes

:heart_eyes_cat:

2 Likes

Looks amazing!

3 Likes

Hello there,

just tried your project, this is really nice!
There is just one thing, at least for me: the mouse is captured forever, no luck with Space and Esc. I have to force quit the window. I am on a Mac mini M1, Monterey 12.1.

5 Likes

Hi again,

I played a bit more with your project and got my mouse back:
First, I added the Escape key to the input bindings, then in your controller.script file, I added these lines to the input function ( the html stuff would need to be added as well if needed):

	-- touch or click event: the mouse is locked, the cursor hidden
	if action_id == hash("touch") then
		pointer_lock_ext.glfw_mouse_lock()
	-- pressing escape: mouse is unlocked, cursor visible again
	elseif action_id == hash("esc") then
		pointer_lock_ext.glfw_mouse_unlock()
	end

Not sure if that is the intended way, but now the mouse can be unlocked again and the project window closed without force quitting it.

7 Likes

Wonderful :heavy_heart_exclamation:

4 Likes

Thanks for sharing! I wondering how make smooth mouse movement

This is amazing!! Well done

1 Like