How to jump in VR

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

Geoff @ TechLeap

2 Likes

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

1 Like

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

1 Like

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

Geoff

2 Likes

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.

2 Likes

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?)

1 Like

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')
3 Likes

I was able to do a simple tutorial that has worked well with our ClassVR headsets. This does create some other glitches when trying to open things, you also jump but it is working for the students.

2 Likes

I think I have made a code that will work. I have a vr project in class ( it is a parkour game) our tech teacher doesn’t know that there is no jump button though.

1 Like

does anyone know how to add a cooldown to this so people cant just jump spam?

1 Like

I believe i have made a bug free vr/tablet/mobile jump button.

if anyone could make it simpler that would be great.
I am used to scratch block code and could think of easier ways using scratch but just the crutial blocks were missing @developers please could you add code blocks such as ‘y of [object]’ and ‘change y/x/z of [Object]’ by [number]. That would be great. :slight_smile:

2 Likes

I’m definitely going to try this. See how it works with our headsets. I’ll keep you updated.

1 Like

Btw does anyone know if you can have a cospaces account that is just for fun and not for edu purposes.

1 Like

I imagine you could buy a single pro license and use it for personal use. That is a good question. I never thought of it.

1 Like

Here is laptop gameplay of button cuz my teacher doesn’t allow us to share.

1 Like

@Fairview any update on whether you think this is a good solution?

1 Like

Looks good, I just haven’t had a chance to try it on my VR headset yet.

2 Likes

I have video of it working on Quest 2.


I don’t think this topic is fully solved though because it would be cool if you could actually press a button on the quest controller to make you jump.

1 Like