Jumping in VR - possible? How?

I have a class creating "Obby"s tomorrow and I want them to be able to play on Class VR headsets. What is the status of jumping in VR and cospaces? Is there a way? Thankyou.

1 Like

It’s mapped to keycode ‘primary’, so you will need to typescript.

I’m having a play with it now. It does seem to exhibit some strange behaviours though.

@EdTechnocation ? Any suggestions? I follow

Okay so it uses keycode ‘primary’ which is only accessible in TypeScript or Python (Well I assume it works in Python. I’m not a Python person so I haven’t tested it)

The odd behavior I mentioned is that it only seems to register the onKeyDown event once the OK/Jump button is released, which means that, onKeyPressed does not work at all, or is unreliable at best (as onKeyPressed is just a shortcut for onKeyUp nested inside onKeyDown)

Here is an example project to demonstrate what I mean.

For ClassVR headset:

CoSpace 1QR

Cheers,
Stuart

Edit: I just noticed that keycode ‘primary’ translates to left mouse button when the CoSpace is run on a computer, with the only difference being that it works as expected.

1 Like

Hi everyone! We’re happy to see you want more functions with the Class VR headsets, currently the jump function is not officially supported but our developers are aware this is desired!

2 Likes

(Belated) thanks Stuart.

I can see how this can work, thanks for the example which I checked out, and grabbed a remix to see the code.

But for the kids I don’t think this will help as they are all using blocks code, not script. And it seems you cannot call one from the other or vice versa.

I don’t know if a trigger was detected in script whether that can write a global property value to the scene which is then picked up in blocks but that would then require polling of the scene property and would start to get pretty ugly for a kids coding session!

Thanks for all the ideas folks.

I don’t know if a trigger was detected in script whether that can write a global property value to the scene which is then picked up in blocks but that would then require polling of the scene property and would start to get pretty ugly for a kids coding session!

It’s possible, but you’re right, it’s ugly:

I found the easiest solution was just to write a small script that translated the camera a meter up then down when the jump button was pressed and run it independent of the block code.

Cheers,
Stuart

I have found an imperfect solution but it works. I aligned a jump button with the camera view. This allows you to jump anytime you click.

VR Jump Function

1 Like

I created a Short Tutorial on how to create a basic jump button for heads sets.

Jump Tutorial

2 Likes