decentraland / sdk

PM repository for SDK
Apache License 2.0
4 stars 4 forks source link

When hiding UI, key inputs not detected #1100

Open nearnshaw opened 5 months ago

nearnshaw commented 5 months ago

Reported by Will and Nikki Fuego

When I press U to hide the ui, inputSystem.isPressed(InputAction.IA_FORWARD)no longer reports the state of the button.

It can be reproduced in any scene with just this snippet:

const playerControlSystemFn = (dt:number) => {
    //THIS STOPS REPORTING CORRECT INPUT STATE WHEN "U" IS ACTIVE
    console.log("inputSystem.isPressed(InputAction.IA_FORWARD);",inputSystem.isPressed(InputAction.IA_FORWARD));
  }
  engine.addSystem(playerControlSystemFn);

When this happens Transform.getOrNull(engine.CameraEntity) does not report correct rotation either.

It can be observed in this scene: https://decentraland.zone/play/?NETWORK=sepolia&position=0%2C0&realm=worlds-content-server.decentraland.zone%2Fworld%2Finfinityengine.dcl.eth

Here it prevents me from moving at all. If I press W to move forward then press U to hide ui while still pressing W, the W gets stuck and I forever move forward until I press U again to enable the ui. "Input data is suspended when the ui is disabled"