How to jump in VR

Here’s a really simple way to create a jump button for mobile/tablet:

Geoff @ TechLeap

1 Like

Hi Geoff, nice sample! However, I’d like to point that the jump button is not visible in portrait orientation on my phone :slight_smile:

Good point, Pavel! I can’t see any methods or properties which expose the viewport/orientation or allow media-queries, so I’m unsure how to adapt this.

I could try using Ray Cast, or have 2 buttons - do you have any other suggestions?

Geoff @ TechLeap

you can press the space button.

1 Like

@SHUN_HEI_SHUM , there is no space button on a mobile phone / tablet / VR headset.

Geoff @ TechLeap

This is now fixed, ie, button available in both portrait and landscape :slight_smile:

Geoff

1 Like

Any word on how to code a Jump button in VR? Maybe using the handset? We have a Quest 2. Students will really love to be able to run their Parkour in VR. thanks.

1 Like

Hiya
We were using this Code successfully recently (before Xmas 2022), but now it doesn’t seem to work :confused: Any idea why? Kids are about to submit their work, and are worried/disappointed that their Worlds no longer work as expected :o
Thanks :slight_smile:
(P.S. It would be great if one of the Oculus Buttons could be programmed as the Jump Button - any progress in enabling these in CoSpaces?)

Hi @MrRad, here is fixed version of the space:

If you want to fix existing spaces, then you need to update code in a _createButton() function.

// Replace the old method which is no longer works
this._jumpText = Scene.createText(0, 0, 0, 'JUMP')

// with updated one
this._jumpText = Scene.createText(new Vector3(0, 0, 0), 'JUMP')
1 Like