top of page

HCI Lab 4: Roll a Ball in VR

  • Photo du rédacteur: quentinaudy
    quentinaudy
  • 20 janv. 2023
  • 2 min de lecture

Finally, in this last article for the HCI module, we managed to transform our Roll a Ball game into a VR version. As for the Android version, this article will be quite short because we just need to convert our space into a VR one. I had some troubles, but the general functioning was not that difficult.



In order to have a cool 3D environment, I decided to change the scales, and to put the gameboard on a table. Now, the major part is to make our camera moves and follow the Oculus, like for the hands.

The first think I did is the importation of the XR Toolkit, that will be used during all the game. We can do this through the package manager, and I also had to import the samples from it. I activated OpenXR, and that's it for the setup.

Then, I created an XR Origin, which corresponds to the player we will control (a camera, a right hand and a left hand). The Input Action Manager is already inside this Origin, I added the Character Controller. If I want to move all my body properly, I need to create a Locomotion system. Inside it, I put all the elements I wanted (like teleportation, snap turn or continous moves). I also associated the scripts to the hands in order to allow all the moves.


After that, I created a simple model for the hands, that I can link to my controller. It is supposed to be nice visually.

Now, we are suppose to be able to move our body, and to move our personnalized arms. But here, if I want to play, I must be able to grab the gameboard. For that, I added a collider to my hands, and a XR Direct Interactor. Finally, we must add a XR Grab Interactable to the PlayBoard in order to be able to move it. Some parameters must be modified, like creating an Attach point where the hand will hold the object. And basically that's it ! We can also add some scripts to change the command mode, but it is supposed to work.

In my case, I didn't had the possibility to try my game on the Oculus because I worked on my own computer, but every parameter was well chosen so it is supposed to work well.






Commentaires


bottom of page