PlayoVR
A Unity demo project using VRTK, PhotonNetwork and PUNVoice
Install / Use
/learn @quintesse/PlayoVRREADME
PlayoVR, a VRTK-PUN-Voice Demo
A small Unity demo project using VRTK for object interaction and VR controller handling, PhotonNetwork for allowing up to 4 people to join the same scene together and PUNVoice so those people can actually talk to each other.

Changelog
- 2018-08-07
- Updated to work with the latest version of all 3rd party dependencies
- 3rd party dependencies are no longer part of the repository
- Fixed gun orientation
- Fixed/updated door handling
- Avatars now have a player name floating above them
- Updated configuration instructions
- 2017-08-18
- In the last update somehow all interactable scene objects were broken. Fixed now.
- 2017-08-12
- Manager scripts are no longer observed components but now use Photon's "Custom Properties" to sync information
- The
NetworkParentManagerwas removed in favor of merging its functionality withNetworkObject - Updated to latest version of VRTK
- 2017-07-18
- Updated to latest version of VRTK
- Updated to latest version of PUN and PUNVoice
- Removed Oculus Ultilities and Avatar
- 2017-09-06
- Fixed creation of duplicate remote players
- 2017-05-11
- Updated to latest version of VRTK
- Updated to latest version of the Oculus Ultilities and Avatar (1.14.0)
- 2017-05-09
- Choose a less infamous name
- 2017-05-05
- Gave the project a proper name
- 2017-05-04
- Added a door to the scene
- Fixed lighting problems with sky dome
- 2017-05-03
- Added a "sky dome" for 360 panoramic photos
- The spheres are now containers for 360 panoramic photos
- Bringing a photo sphere close to your head shows a personal preview
- Placing a photo sphere on the central pedestal causes the sky dome to change for all connected players
- 2017-04-25
- Added
NetworkSnapManagerscript for syncing snap actions over the network - The network scripts now have custom editors that show their current state which makes debugging much easier
- The gun now animates (thanks jimthegrim)
- Added
- 2017-03-23
- Simplified project by removing DFVoice support and voice cli arguments
- 2017-03-22
- Added support for Photon Voice chat
- 2017-03-20
- Changed
NetworkParentableObjectto stand-alone `NetworkParentManager - Introduced
NetworkBehaviourbase class for all network classes - Made
onChangeOnlypart of all network classes and made it default tofalse
- Changed
- 2017-03-19
- Now supporting objects that are re-parented
- 2017-03-17
- Fixed
SDKChooser - Split the code up in modules
- Code can now work without DFVoice
- Fixed
- 2017-03-16
- Updated to use the
SDKChooser
- Updated to use the
- 2017-03-15
- First version
Configuration
To be able to use this example project you'll have to set it up first:
- Open the project in Unity.
- Make sure you have TextMesh Pro installed by going to
Windows > Package Manager, clicking theAlltab, then selectingTextMesh Proand clicking the install button. - In the menu bar click on
Window > TextMeshPro > Import TMP Essential Resourcesand import all. - Clone VRTK or download as a ZIP.
- Copy
VRTK/Assets/VRTKto theAssetsfolder of this project. - For VRTK to work with any VR headsets you will need to install their respective SDKs. Read the section on 'Supported SDKs' here on how to do that.
- Normally you will only need to follow the instructions about importing the SDKs, the project already contains all the necessary camera rigs. If you encounter problems like missing scripts on the SDKs present in the Main scene you should delete those SDKs and follow the full instructions on how to re-add them.
- If you import the
SteamVR Pluginand get a dialog about recommended project settings that just won't go away you can simply click "Ignore All". - If you import the
SteamVR Pluginand you get an error saying "The type or namespace name SteamVR_PlayArea' could not be found" you are using a plugin version 2+ that isn't supported by VRTK right now. Instructions on how to solve this can be found here. - If you imported the "Oculus Integration" and you get a dialog "Update Oculus Utilities Plugin" then just select "Yes" and "Restart" (don't save changes to the scene).
- In the Asset Store search for
Photon Unity Networking Freeand import all of it.- If you get a dialog "API Update Required" just select "I Made a Backup. Go Ahead!".
- If you get a dialog "PUN Setup" just click
SkipandClosefor now.
- In the Asset Store search for
Photon Voiceand import all of it.- If you imported the "Oculus Integration" and you get errors in
Assets/Oculus/Avatar/Samples/SocialStarterjust delete that entire folder.
- If you imported the "Oculus Integration" and you get errors in
- In the menu bar click on
Window > Photon Unity Networking > Highlight Server Settings. - In the
Inspectorwindow sethosting(useBest Regionif you're not sure what to use) and set theAppIdandVoice AppIdfields to use the IDs you got from Photon. - Open the
Mainscene found in theScenesfolder in theProjectwindow. - Hit
Play!
Testing locally
To test locally without another computer you can create a special shortcut that will run the program in normal, Non-VR, mode:
- In the menu bar click on
File > Build Settings... - Click the
Buildbutton, choose a destination folder and name your executable. - In the Explorer window that popped up right-click on the
.exeand selectCreate shortcut - Right-click on the newly created shortcut and select
Properties - In the
Targetfield at the very end just after.exetype a space and add-vrmode none - Click
Ok - Run the executable by double-clicking the shortcut
- Hit
Playin the Unity Editor (or run the.exeinstead of the shortcut)
You could also add shortcuts for the other VR modes as documented below.
Command line arguments
-vrmode: force the program to use the specified SDK. Valid values for<NAME>are:openvr(for SteamVR)oculusnone(no VR support, will output to the monitor and use mouse and keyboard)
Using networked interactable objects
If you want to add networking to your VRTK interactable objects then you just need to follow a couple of simple steps. This assumes you already have a project that has both the VRTK and Photon Unity Networking assets (you can find them on the Unity Asset store) and that networking has already been set up. So for each object that has a VRTK_Interactable_Object script you do the following:

- From this project copy/drag the
NetBaseandNetVRTKfolders - Add a
PhotonViewscript - Add a
NetworkObjectscript (leave the default options) - Drag the
NetworkObjectscript to theObserved Componentsof thePhotonView - Optionally add a
NetworkGrabManagerscript if the object can be grabbed - Optionally add a
NetworkSnapManagerscript if the object can be snapped to a drop zone
NetworkGrabManager
This script handles the transfer of "ownership" that Photon imposes on object. Only an object's owner is allowed to send updates about it, other can only receive updates. So to be able to pick up an object and move it we must first tell Photon that we want ownership of the object. The NetworkGrabManager does this for us.

Properties:
- Own Additional Photonviews : This can contain a list of additional
PhotonViewscripts that should change ownership when the player grabs the current object. This is useful for complex objects like for instance a door where the user might grab a door knob but the script for syncing the movement of the door is on the door, not the knob. - Grab Owner : (Read Only) Shows the PUN ID of the plauer currently holding the object or
0if it's not being held.
Requirements/suggestions:
- a
VRTK_InteractableObjectmust exist on the same object
NetworkSnapManager
This script syncs the action of an object being snapped to a drop zone across the network. If you don't use this script it might seem that everything works fine but a) the VRTK on remote clients doesn't really know the object is being snapped and b) the moment the client that performed the snap disconnects the "illusion" disappears.
Properties:
- Snapped To : (Read Only) Shows the path/id of the object that we're snapped to.
Requirements/suggestions:
- a
VRTK_InteractableObjectmust exist on the same object
NetworkObject
This script handles the synchronization of position, orientation and movement of an object between clients.
It is NOT necessary to use this script if you're happy with the way Photon's NetworkTransformView and NetworkRigidbodyView work! I just happen to like this script better than theirs.

Properties:
- Parent : Synchronizes changes to the location of the object in the object hierarchy. For more detail see below.
- Position : This determines the way in which the position of the object will be synchronized with the other clients. It can be set to one of the following values:
- None : no synchronization will happen, the value will always remain unchanged
- Set : the value will be set the moment a client receives it, no interpolation will happen
- Lerp : the value will be gradually changed (interpolated) in the time between network updates
- Rotation : This determines the way in which the rotation of the object will be synchronized with the other clients. It can be set to the same values as men
Related Skills
node-connect
346.8kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
107.6kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
346.8kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
346.8kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
