talkol / spiderman

Spider-Man VR Experience
https://spiderman.webvr.link
MIT License
140 stars 45 forks source link

Hands move away without camera in oculus quest #5

Closed cyber-hub closed 4 years ago

cyber-hub commented 4 years ago

Hi, nice idea I would like to play, but sadly hands are in the air above the head and move away after triggerpress on oculus quest.

ghost commented 4 years ago

Experiencing the same thing with an Oculus Rift S.

KumaVolt commented 4 years ago

Sadly experiencing the same issue with oculus quest

fernandojsg commented 4 years ago

I see the same issue with Firefox Reality on Quest, while it seems to work correctly on Oculus Browser. I tested also on Firefox and Chrome desktop using the WebXR emulator and I found random behaviour. I believe it's some async issue when the default camera is initialized. The index.html doesn't have any camera so aframe is injecting initially a default one (and activating it), but then in player.js a new one is created and added to the player entity (https://github.com/talkol/spiderman/blob/master/player.js#L24-L34). Some things I tried:

I've submitted a PR (https://github.com/talkol/spiderman/pull/7) with the first change, just as a workaround that fixes the behaviour, but ideally that's should not be the final solution here.

Any hint of what can be going on here @dmarcos ?

fernandojsg commented 4 years ago

actually I believe it should be enough to force the activation in the play instead of doing it on each tick, that was just a big of brute-force approach :)

dmarcos commented 4 years ago

I haven't investigated. Moving all those entities created programmatically to the HTML will clean things up and likely problems will go away:

<a-entity player="mass: 70" position="0 0 0">
  <a-entity camera look-controls raycaster="..." position="0 1.6 0" wasd-controls></a-entity>
  <a-entity hand="left" raycaster="..."></a-entity>
  <a-entity hand="right" raycaster="..."></a-entity>
   .
   .
   .
</a-entity>