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.
Install Steam and SteamVR. This is a requirement for OpenVR development in Unity.
Create a new Unity project.
Import the Oculus Integration for Unity from the Asset Store.
Open the CrossPlatform scene in Assets/Oculus/Avatar/Samples/CrossPlatform.
From the Oculus Dashboard, create a placeholder Oculus Rift app and copy the App ID.
On the menu bar, select Oculus Avatars > Edit Configuration and paste the App ID into the Oculus Rift App Id text box in the Inspector window.
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.
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.
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 Oculus Rift App Id field at Oculus Avatars > Edit Configuration.
Use LocalAvatar GameObjects for Avatars.
Use Oculus User IDs in the Oculus User ID field of the OVR Avatar (Script) component of the LocalAvatar GameObjects.
The scene contains 12 LocalAvatar GameObjects, 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:
On a PC with the Oculus app installed, these files can be found in C:\Program Files\Oculus\Support\oculus-runtime by default.
You must also include the Oculus Avatar SDK License with your app.