Unity CrossPlatform Sample Scene

The Unity CrossPlatform sample scene shows how Oculus Avatars can now be used, with some limitations, on non-Oculus PC platforms. The sample scene demonstrates this by querying and showing avatars without initializing Oculus-only Platform features that are still required for complete avatar functionality.

Regardless of platform, it’s currently possible to use an Oculus user’s customized avatar in any app that uses the method shown in the sample scene. However, cross-platform avatar support is still in its early stages and there are currently some limitations. For example, non-Oculus users can’t customize their own avatars. Instead, there are 12 default avatars included in the sample scene that can be provided as options to non-Oculus users. Another limitation is that controller bindings for hand poses on non-Oculus controllers haven’t been implemented yet.

Setup Instructions

  1. Install Steam and SteamVR. This is a requirement for OpenVR development in Unity.
  2. Create a new Unity project.
  3. Import the Oculus Integration for Unity from the Asset Store.
  4. Open the CrossPlatform scene in Assets/Oculus/Avatar/Samples/CrossPlatform.
  5. From the Oculus Dashboard, create a placeholder Oculus app for your device and copy the app ID.
  6. On the menu bar, select Oculus > Avatars > Edit Configuration and paste the app ID into the appropriate field for your device.
	**Note**: In a multi-platform app that includes Oculus Rift, Oculus Platform features would normally be initialized at this point. This has been omitted from this sample scene to show that Avatars work without Platform features.
  1. Make sure OpenVR is enabled and prioritized for use when the scene is played:
    • From the menu bar, select Edit > Project Settings > Player.
    • In the Inspector window, expand XR Settings and add OpenVR if it’s not already there.
    • Remove Oculus (or drag it below OpenVR) so that OpenVR is used when the scene is played.
  2. Click the Play button.

The scene should play using SteamVR rather than the Oculus platform, and you’ll see 12 different Oculus Avatars in front of you.

Using Avatars in Your Cross-Platform Apps

To use avatars in cross-platform apps, do the following:

  • Make sure you have a network connection.
  • Import the Oculus Integration for Unity.
  • Place your app ID in the appropriate device field at Oculus > Avatars > Edit Configuration.
  • Use LocalAvatar game objects for Avatars.
  • Use Oculus User IDs in the Oculus User ID field of the OVR Avatar (Script) component of the LocalAvatar game objects.

The scene contains 12 LocalAvatar game objects, each with a different customization. These Oculus User IDs are available to be used by non-Oculus users in your own app.

When you replicate a scene to users in a cross-platform multiplayer app with both Oculus and non-Oculus users, you must include a value for the Oculus User ID field for every user to use their avatar. For Oculus users, it will be their own Oculus User ID. Currently, for non-Oculus users, it will be one of the 12 Oculus User IDs provided in the sample scene.


When packaging a cross-platform app using avatars, you must include the following files in a Plugins directory in your Unity project’s Assets folder:

  • libovravatar.dll
  • OvrAvatarAssets.zip

On a PC with the Oculus application installed, these files can be found in C:\Program Files\Oculus\Support\oculus-runtime by default.

Note: Unity’s build process will only copy DLL files in a Plugins directory to the output Plugins directory, so you must manually copy OvrAvatarAssets.zip to the output Plugins directory. You can automate this with a script that adds a custom build command. For more information, see the Unity Build Player Pipeline documentation.

You must also include the Oculus Avatar SDK License with your app.