HCI Lab 4


Welcome back!

In this post, I’m excited to guide you through the process of adapting your Rollaball application for virtual reality (VR) gameplay. In our last lab of HCI, we had a hands-on experience using Oculus VR headsets, which offer an immersive experience, elevating gaming to a whole new level. I’ve outlined the steps to get you started. You can also use this website to help you with the setting up.

Making the Rollaball game work in virtual reality started with getting the game size just right for VR play. We wanted players to grab and interact with the game board, so adjusting its size was crucial. Once that was sorted, I found a room setup in the Unity Asset Store—a cozy room with a bed. I placed the Rollaball game board on the bed within this virtual space. While I went with this ready-made setup, you can get creative and design your own environment using Unity’s tools. The main aim is to create an awesome space where players can dive into the Rollaball game in VR.

Here is a picture of my room :

blog placeholder

Once that was done we delve into the technical aspect to make the game playable in virtual reality.

  • In the package manager, install OpenXR Plugin an XR Interaction ;
  • In Edit go to Project settings select XR Plug-in Management,and tick OpenXR ;
  • In the project windox, follow the path Assets > Samples > XR Interaction toolkit > 2.2.0 > Starter Assets and for each asset, in the inspector, select the button Add to ActionBasedContinousMoveProvider default ;
  • In the Hierarchy, create an XR Origin, by right clicking XR> XR Origin VR and in the inspector, add Character Controller and Character Controller Driver to the XR Origin ;
  • Right click in the Hierarchy, go to,XR > Locomotion System (Action based) and drag and drop it in the Charactor controller driver in the inspector for the XR Origin ; Your inspector for XR Orignin should be the same as this one :

blog placeholder

blog placeholder

  • Now you have to set you Right and left HandController as follow :

blog placeholder

  • Create an empty Prefabs (HandContoller) in the Prefabs folder, add a cube and a cylinder as below ;

blog placeholder

  • For left and right handController, in the Inspector remove XR Interactor, Line Rendere and XR Interactor Line Visual. Create an empty GameObject called ModelParent under the HandController, add the created Prefabs and ModelParent, add a sphere Controller to your handControllers ;

  • Create empty object on both sides of the board, these will be ths attach points and add XR Grab Interactable to the PlayBoard

You should now be able to start to play your game with the headset !