top of page

HCI Lab 4

  • yasobel
  • 9 oct. 2020
  • 3 min de lecture

Dernière mise à jour : 31 oct. 2020

Creating a VR application.


Now that I've made a Roll a Ball game that works on my computer and on a phone, it was time to create a VR application. In this lab I used the Occulus Rift CV1, VRTK4 to create a controller and Occulus Integration for hand tracking.


The first that I've done is to install the VRTK4 package that will be used as a base for the project. Then, in Project Settings, Player, I enabled the "Virtual Reality Supported" option.

Next, I added two things to the project:

-> Occulus Integration that I've downloaded from the asset store

-> The Roll a Ball game that I've export to my Desktop than that I've imported to the new project.


After importing the game, I've had some errors in the project :

This was due to the fact that the Roll a Ball uses UnityEngine.InputSystem that we won't be needing anymore. To get rid of the errors, I just had to comment all of the lines of code using the InputSystem.


Next, it was time to put our scene in place. So, I added a table and a floor and I also deleted the camera because we will be using the one provided by the VRTK4. All of the elements of the scene are gathered in an empty object named "Environment".

After that I added a new empty object named Roll a ball that will contain the elements of the game (player, ground, pickups and walls).



After scaling the game, we add a collider that fits the size of the ground so that we could interact with it and move it as we please later on.

However, we now have a problem with the physics of the game and the colliders. The player and the ball should be able to interact with the ground.

The way to fix this is by adding a layer to the Roll a ball object as well as to the player. I called the one used for the player "Roll-a-ball" and the other one "VR grab".

Last time, I added a Tilting ground script to the ground so that the game can be played on a phone. In order to have a VR application, I had to remove this component because I don't need it anymore.


After setting up the scene, I had to set up the VRTK. In my opinion, this was the worse part of the lab because everything had to be done manually. I don't know if there is a more appropriate software for VR rather than Unity, but it's definitely not the fastest one.

Since I removed the basic camera at the beginning I had to add another one to be able to play the game. I used the OVRCameraRig that was in the Occulus Integration package

and I added all of the elements used for tracking the player and the space around him.

Then I added an interactor (For the left and right controllers) to be able to hold and move the ground when pressing on the buttons.

And finally I added an interactable of which the roll a ball is a child.


Basically everything works fine, but I've encountered some problems:

-> At first the ball would fall and go through the walls. This was because I forgot to add a rigidbody to the game at first.

-> My mac wasn't appropriate for such voluminous projects and it was too slow to work on, so I would advise you to use a portable disk or another laptop.

So, I've wasted a lot of time trying to export everything on the school computer to do the lab but I managed to set everything up without loosing any parts of the project.

-> I could grab the ground and move it but sometimes I would lose the ball and it would fall off.


Overall, I think that this was the hardest lab because it was my first time manipulating a VR environment, and the final product is not perfect. I sadly couldn't post any videos because I don't have access to the computer and the VR headset anymore due to the restrictions on campus.



Posts récents

Voir tout

Comentarios


bottom of page