hicetnunc2000 / hicetnunc

hicetnunc UI/UX
http://hicetnunc.xyz
800 stars 282 forks source link

Allow Pointer Lock Permission Policy #629

Open local306 opened 3 years ago

local306 commented 3 years ago

I have an interactive WebGL project where I am trying to lock the mouse cursor when the user clicks within the frame. It's a first person experience and without the cursor lock, it's incredibly tough to navigate with the mouse look because the input drops outside of the narrow container width from the browser.

In my Chrome console, I'm getting:

Blocked pointer lock on an element because the element's frame is sandboxed and the 'allow-pointer-lock' permission is not set.

Is it possible to allow this?

andrevenancio commented 3 years ago

What is the OBJKT number? Its under consideration. hidding the mouse cursor is not a very good practice unless you're on an immersive experience like fullscreen. otherwise people get lost. you can hide it via css. is this how you're currently doing it?

local306 commented 3 years ago

@andrevenancio I don't have an OBJKT per se as I don't want to spend the gas money minting something that isn't working as intended, but I've attached a super simple zip to try out using Unity's default FPS controller. Works in the HEN preview part of the minting process minus the mouse lock.

NFTSample.zip

you can hide it via css. is this how you're currently doing it?

To be honest I'm not entirely sure as this is behaviour is handled by Unity's engine and then converted into the necessary HTML + CSS.

In something like itch.io + Chrome, when you click the canvas the cursor is hidden and locked but you get a prompt saying to press Escape to show cursor again, if that makes it any less hostile / invasive haha.

szostek commented 3 years ago

Hey guys, was there any resolution to this? I have the exact issue when building to HTML from UE4. I have an FPS experience that works perfectly on a local server, and works when minted on HEN, however, the mouse cursor leaves the canvas when moved past an edge. I get the exact same error message in console:

"Blocked pointer lock on an element because the element's frame is sandboxed and the 'allow-pointer-lock' permission is not set."

It's not really necessary to hide the cursor, I just want to lock it once the user clicks into the canvas, and released when user hits escape. Is there any way around this permission?

I can mint mine and leave it up for testing, if you'd like to investigate it. Let me know.