Proper way of getting mouse or touch delta to control camera rotation

Hi guys, Iā€™m trying to make a first person camera rotate properly, what would be the best way to get the mouse or touch delta?

Original Post on Discord

by user 262331051802755072

Using this method should help: this.context.input.getPointerPositionDelta(0);

understood! would this work even if the pointer is locked?

by user 262331051802755072

Not sure to be honest

Just debugging that - itā€™s not handling that case correctly. Next update will fix that later today :slightly_smiling_face:

Can you try with this version? Discord

will try @marcel :cactus: thanks, also a related question, Iā€™m testing the camera on iPad and the screen doesnā€™t react to touch as it does to mouse on pc, what I mean is the screen in all the examples works as if the game window was fullscreen, on iPad itā€™s working as if when touching I was dragging the whole page and the pointer is unusable, could you point me in the right direction? tthis is the glitch build https://foregoing-juicy-mind.glitch.me/?room=tiny_snail_301

by user 262331051802755072

Are you using the getPointerPositionDelta method above? I think its not implemented for touch - I need to check that

yes, I am using getPointerPositionDelta, now Iā€™m intrigued as to how to handle the mouse vs touch, pointer seemed like a way to handle both

by user 262331051802755072

Yes it should - touch does get through the pointer info, Iā€™ll test in a bit.

Btw the description sounds a bit like something on top might be blocking the pointer event on iOS? Is that possible?

not sure, Iā€™m testing from the glitch link I shared here

by user 262331051802755072

Does local dev not work for you for some reason?

yes it does, but Iā€™m not the only one testing it so it makes sense via glitch

by user 262331051802755072

Ah i see ok :slightly_smiling_face:

You can use the same local ip address if youā€™re in the same network btw (just in case you didnt know :smiling_face:) - but I guess thatā€™s not the case

actually went ahead and tried local and got an error I had not seen before:
Failed to execute ā€˜defineā€™ on ā€˜CustomElementRegistryā€™: the name ā€œneedle-engineā€ has already been used with this registry.
Local isnā€™t working for me on this project
O_o

by user 262331051802755072

I think this happens when vite has a hiccup - try restarting the server

same
image.png

by user 262331051802755072

Is there a server still running by any chance?

no, but glitch export does work

by user 262331051802755072