Friday, November 26, 2021

Setting up VRIF with Normcore in Unity

Basic idea to set up VRIF interaction framework to work with normcore goes like this.

You need the Realtime + VR player prefab which comes with the normcore install dropped into your scene and the XR rig Advanced which comes with the VRIF install.

1. Now that they are in your scene expand out the XR rig advanced so you can see the hand anchors.



2. Then the Normcore Realtime + VR player should be in the main scene with it as well.

3. Now click on the Realtime + VR player so you can get to it's Realtime Avatar Manager script in the inspector on the right.

4. Now drag the items from the XR rig advanced in the hiarchy to the Realtime Avatar Manager like so ( The script should be active, not Deactivated like in my screen grab)


The VR player is the normcore Prefab Avatar that will get instantiated automatically when you connect to a normcore room. Basically that local XR rig "puppets" the Normcore prefab Head and Hands using the transforms you linked in that Realtime Avatar Manager script.

Anything in the Normcore VR player prefab is what other players will see when you connect to a room, anything that is in the XR rig will just be visible to you locally.

Now we need to put a copy of the VRIF hands into the VR player prefab so that the other players can see them.

1. Open up the VR player prefab. 

2. From your project drag the XR rig prefab into your VR player so that you can get to some items that are inside of it. UNPACK that XR rig prefab that you have pulled in so you can reparent items. 

3.  Once you have UNPACKED that XR rig prefab and it's sitting there for you to work with. expand the hiarchy  
XR Rig Advanced>PlayerController>CameraRig>TrackingSpace

4. You should see the Right hand anchor, select that and drag it ( and of course all it's children are coming with it) and place it under the Right hand hiarchy of your VR player. 


5. Now do the same with the left handanchor.

6. You would place any head models you want the other players to see under the head game object in the VR player and a torso would go as a child of the head (with a script or playmaker to cause it to follow the head)



Note with this setup when you grab you will see the other player grab as well because VRIF doesn't know it isn't you grabbing. To fix this you need to disable the grabber game object in the VR player if the grabber isn't on your local computer. We will get into that more in a future tutorial.