How to Jump

EDIT: The VRCWorld Prefab now has Jump Impluse, Walk Speed and Run Speed variables on it via an UdonBehaviour so each world enables jump by default. The below information is still correct but no longer necessary.

Enabling jump is very easy now.

What you want to do is set the ‘Jump Impulse’ of each player as they join your world to be something greater than 0. Create a new Udon Behaviour and put it on an object in your scene (doesn’t matter which - maybe VRCWorld to start).

The simplest version looks like this: image

Udon Graph Code to Copy-Paste

AJWSzW7bMAzHXyXg2QrkyJacADlszQ5Zh65YNl+GwJBkuvAq24EttTPcPNkOe6S9wuQ66z6xZeCFpCSSv7/45dPnAe6kcQir9wMUzpgrWfkAXtxhbbOdla2FAFyZ+5wWXLCCKlIkQpAII01UrBiJFWWS5zzXTPnLh6YrbdnUsBrgI6xIEs1pAL33wsWcHgOomxzfbTed77kPoDDN/SkCyWSUyzwhISs0icbiiVCKKE0pj2W8pBjDfqqQjmM/1jgGP42evrnYbS6fyw6v0N437W1Z38yz7AZt9qrR0lwb2WObZd/veW9KPjuUT7RhyEOaS0riQiQkijgnyZIVREpRqIhJpDr5A+0i5Cdc8Q/a8zl+nM+T7NC+dNVhWx2c6dDHfWex2nlM8xSljYf4hnKWrL+hjL/1CML4ryBnifNAfU34O/MAri5t/1p9QG3TaREHKOvOylrjdgOrsXNnWw93OgYYdfr/Z5Mu80mmYFZ1umlNqYJZim3nqdd+TUcLZhfOWNfiukZnW2mC2bVTptSX2L9tbrFeKyFkrGMeLlmENFk+LOC49/YV

On Start, this sets the Jump Impulse of the Local Player to 2. That’s all it takes!

If you want to play with the height of the jump without having to jump into the graph every time, you’ll want to use a public variable. For that, we’ll add a float variable, check the ‘public’ box, and hook it up to the impulse input. It looks like this now:

Udon Graph Code to Copy-Paste

AM2V307bMBTGX6XydVw5ju3ElbgYsE2MiaGV9WaqIts5RgE3qRIHVpU+2S72SHuFuZTyr2hDKpWm9CKJj9Lf99nfOb9//pqjK+U6QIPvc2Q7507UJDygkWpKpR3kw1nrYTIsq3MHKEJdWYRVkdKUyyLB1ABgRhODVUY0lsoaaWKZJDYOxdO6LX1ZV2gwRz/QALOM9UmEZmhASZ8sIlTVBXw7OmzDv6NQ//AbR8i6+vpubbyqHC1B21vSrir97Iu+AONHK/w5KqvWq8rA0SEaLD/e+iZQ3y2jlY7+SkjUm7Smblypo94ImjYw7gW05RX1Djrnuwb2Kuh8o1zUO+20K80xzM7qS6j2dJoqbrgIMhmQTN4QtIi2Qbp9+bZIF91kejSZdq6F7eD269qBqt6W7qzp/kesD2pru3axl1VdBarxkutRQD+Cz9chvc+lFDQmkKVYW24xIybGUkvAiRaqUIJQLewLuaRc3OUyTsVmMHcXxh24RQgxmpMUE85DaxLW4Iyr0J9SyWLGtUgTsunm+yuofD70qvH3ZnJprdApxyZhDDNDGc5UYbFNAXjMCqqsesFMse5x2XMnn/q4bKIB2aTYisDHRKqwplThQvEitFQRNpOj524/Bx99PRgeHu+rFk7AX9fNZTC0n+fn4XR8ro1yp07NoMnzh7pwt3r5blrea40LmpIssGRJODNMJhZrogiOuSBaWprZgr2gNZbrgyPp39W+XsdjvqBkCP7TQzPLn8yj9dOoDiIezaZ/27ohJaHrXducTK8xJwyB6FXxC4Vvn6ctm9YOZiJdZmy8+AM=

This way, you can easily change the amount from the inspector rather than opening the graph each time.

image

I have a challenge for you! Can you make a scene that lets each player set their own Jump Impulse? Maybe with a Slider to keep it within sane limits? If you go through all the tutorials in Assets/Udon/Examples, using the Readme as your guide, I bet you can do it.

2 Likes

I didnt know that was there, Ill have to look into that tomorrow.

1 Like

You might also wana make a note of gravity as that affects jump as well.