Some simple things in your world will work just by pressing 'Play' in the Editor - mouse events, timers, things that don't need interaction from avatars or networking. For a lot of the interesting functionality, you're going to need to make a build of your world that runs in the actual VRChat Client.
Open the UdonExampleScene from the VRChat Examples folder - this scene has lots of great reusable Graphs from which you can learn. It's all set up to work as-is, so we can use it to make sure everything's working.
- Start by creating a new project, importing the Udon SDK, and opening up the VRChat Control panel through the Menu Bar under VRChat SDK > Show Control Panel
- Enter your Login information on the 'Authentication' tab and press 'Sign In'.
- Click on the Settings tab and look for the 'VRChat Client' entry at the bottom. This is the VRChat Client that Unity will use to test your worlds. If you don't set this, your worlds may not launch correctly.
Press 'Edit' to bring up a File Chooser, then navigate to the place you installed VRChat and choose the VRChat.exe program. Here are some default places it might be:
- Steam: C:\Program Files (x86)\Steam\steamapps\common\VRChat\VRChat.exe
- Oculus: C:\Program Files\Oculus\Software\Software\vrchat-vrchat\VRChat.exe
- Viveport: C:\Viveport\ViveApps\469fbcbb-bfde-40b5-a7d4-381249d387cd\1597468388\VRChat.exe
- Switch to the 'Builder' tab. We need to set up our Layers and Collision Matrix to the way that VRChat expects. Just press the 'Setup Layers for VRChat' button, then 'Do it!' on the popup that appears.
Next, do the same thing for the 'Set Collision Matrix' button.
With all of our settings correct, we're ready to make a build of the scene. Once you've cleared the issues from the Builder tab by following the instructions above, you have access to the 'Build & Test' button. For this first test, turn on 'Force Non-VR', then press Build & Test.
Your VRChat client should launch into a local copy of this world where you can run around and try everything out!
In order to test Synced Variables and Custom Network Events, you need multiple people in the same world. The easiest way to accomplish this is to use the Builder tab to launch multiple clients. Close the VRChat client window you just launched if it's still open, and change the 'Number of Clients' to 2, then press Build and Test again. This time, Unity will open up two VRChat clients, with your same avatar in both of them. You can swap between the windows to control your two avatars, and even see yourself talking in both of them. Try playing with the Synced Variables area. The first avatar that loads in will be the Master of the instance and therefore Owner of those GameObjects, so they will be able to update the UI Elements, whereas the second avatar can only see the updates. The one exception in this scene is the 'SyncButtonAnyone' which transfers ownership to whoever clicks on it.
Bug: Don't use the Chair when running Build & Test with multiple clients.
There's an issue right now that all of your avatars will get 'sat' into the chair, and it will be difficult to get them out. We'll remove this warning when that's fixed. For now, you'll need to Publish the scene to test out Stations in your world.
Updated 6 months ago