The purpose of this project was to develop a virtual reality scenario to help someone get over their phobia, and the phobia I chose for the project was insects. Insects included are an ant, a butterfly, a beetle, a ladybug, cockroaches, and flies. This project was developed using Unity 2019.4.28f1 and the VRTK v4 library.
The project is meant to run on an Oculus Quest headset. All screenshots and the video on this page were captured using an Oculus Quest 2 headset.
Some objects (shown in video and listed below) are interactable, meaning they can be picked up, dropped, and thrown by holding the lower trigger on a controller while the controller is touching them. There is a cabinet in the scene that can be opened by grabbing and moving it similarly. A button in the scene can be pushed by moving a controller into the button.
People with an insect phobia can try to look at the ant and become used to its movements.
A person with an insect phobia could look at the fly moving and hear the fly buzzing to become more accustomed to flies.
When this cabinet is opened, a cockroach flies out at the user. It could help someone with an insect phobia by getting them used to an insect coming toward them.
This area contains a button that spawns flies. The fly swatter can be used to destroy spawned flies (and not other flies in the scene). A maximum of 5 spawned flies can be in the scene. Someone with an insect phobia could feel empowered over insects by destroying them.
The bug models are meant to be toy-like for someone with an insect phobia to hold and acclimate to them.
The fly in this frame is stationary. A user with an insect phobia could look at it to lessen their fear without needing to look at a moving insect.
The butterfly is meant to be a non-threatening and less scary insect for someone with an insect phobia to get used to.
Install Unity Hub from here.
Install Unity version 2019.4.28f1 from here by clicking the Unity Hub button for that version. Add the Android Build Support, Android SDK & NDK Tools, and OpenJDK modules when installing.
Install Blender 2.93 here for importing models into Unity.
Clone the project's GitHub repository into a folder using the git clone command or by downloading the project ZIP file by clicking Code -> Download ZIP on the GitHub repository page and extracting it.
Open Unity Hub, click the Open button, and select the project folder. Click on the project with the project folder name in Unity Hub to open it in the Unity Editor. The VRTK v4 packages should now install.
Open Assets/Scenes/ScareCoOffices.unity by double-clicking on it in the Unity Editor Project window.
To use a simulator in the Unity Editor, enable the CameraRigs.SpatialSimulator GameObject and disable the CameraRigs.UnityXR GameObject by selecting each of them in the Hierarchy window and toggling the checkbox in the top left of the Inspector window. Click on the play button at the top middle of the screen to start and stop the simulator. (Press the Escape key to unlock the mouse cursor.) Toggle the GameObjects again to return to being able to build for a headset.
Connect an Oculus Quest headset to your computer over USB. Make sure your Quest has developer mode on. Select Allow on your headset to allow your computer to access the headset's data.
Click on File -> Build Settings and select the Android platform. Select Oculus Quest in the Run Device menu. (Click Refresh if it does not appear.) Click on File -> Build And Run, select a file name and location for the APK file, and click the Save button. After building, the application should be open on the headset.
By abouttreefiddy on CGTrader - https://www.cgtrader.com/free-3d-models/food/fruit/3d-asset-watermelon
By Aaron S. on 3D Warehouse - https://3dwarehouse.sketchup.com/model/u72c76e3e-1e6c-4cfc-8ea9-528ceba4a79a/Picnic-Basket
By Manolis S. on 3D Warehouse - https://3dwarehouse.sketchup.com/model/198d36bcfacb1a7a4212ff51b27f0221/cookies
By slavamal2003 on CGTrader - https://www.cgtrader.com/free-3d-models/animals/insect/ant-3d
By pixelmonkey 3. on 3D Warehouse - https://3dwarehouse.sketchup.com/model/904cac5ad50c4b0c78fe949fc1419876/Garbage-Bag
By Martin C. on 3D Warehouse - https://3dwarehouse.sketchup.com/model/4d0c5e1d-2da3-48b7-ae2d-5e3f271cef43/Paper-Trash-set
By inonzur94 on CGTrader - https://www.cgtrader.com/free-3d-models/household/kitchenware/paper-cup-coffee
By Glowbox 3D on Sketchfab - https://sketchfab.com/3d-models/low-poly-house-fly-diptera-2baa84955f704a4091a274ef4acec24a (No changes were made. License)
By SketchUp on 3D Warehouse - https://3dwarehouse.sketchup.com/model/258d1717fdc9a93948eb25f0f4edb37e/Sunflower-plant
By Angelie P. on 3D Warehouse - https://3dwarehouse.sketchup.com/model/67e6aef8ad6b29b9fe5adaeab9475bc5/Midlight-Butterfly
By Øyvind E. on 3D Warehouse - https://3dwarehouse.sketchup.com/model/c42a7d7d7fb084b46c63b8b48495261a/Picture-Frame
By Chomp O. on 3D Warehouse - https://3dwarehouse.sketchup.com/model/ade154c369446ba720fbe0d3eb7afe6/More-insects
By KARE SketchUp on 3D Warehouse - https://3dwarehouse.sketchup.com/model/3589689f-1056-4cf1-b314-cf92d00b6f77/60748-Wall-Decoration-Herkules-Beetle-Matt-Black
By daggafiya24 on Sketchfab - https://sketchfab.com/3d-models/fly-swatter-9ce080633f6f48be9ecc761bbeb7f640 (No changes were made. License)
By Reddi on 3D Warehouse - https://3dwarehouse.sketchup.com/model/023ea689-e881-4359-83c5-794ccfbe5188/Lady-Beetle
I created these models using Blender.
Ambient Sound: Fluorescent Light Buzz by Sauron974 on Freesound - https://freesound.org/people/Sauron974/sounds/273625/
Four Unique Sounds:
1. Button Click by JarredGibb on Freesound - https://freesound.org/people/JarredGibb/sounds/219478/
This sound plays when the user presses the button all the way down.
2. Fly Buzz by Kneedless on Freesound - https://freesound.org/people/Kneedless/sounds/167455/
This sound plays at the location of the fly near the trash and gets louder as the user gets closer.
3. Door Creak by JarredGibb on Freesound - https://freesound.org/people/JarredGibb/sounds/219499/
This sound plays when the cabinet is fully opened.
4. Splat by gprosser on Freesound - https://freesound.org/people/gprosser/sounds/360942/
This sound plays when a fly is destroyed using the fly swatter.
The overlay in these screenshots displays a graph of the headset frame rate in frames per second over time, with 0 FPS at the bottom and 72 FPS at the top.
The frame rate is high when looking at the models in the scenario from a corner of the room. Frame rate is low while the scene is first loaded.
The frame rate is high when the user observes the fly while holding two interactable objects. The frame rate dip is from when the player first touches an interactable object with their hand.
The frame rate is high while the user generates flies with the button and destroys them using the held fly swatter.
Interactable (Grabbable, Droppable, Tossable) Objects
1. Beetle
2. Fly Swatter
3. Ladybug
4. Crumpled Paper
5. Coffee Cup
Objects With Colliders
1. Trash Can
2. Trash Bag
3. Picnic Basket
4. Flower Pot
5. Cabinet
Interactable Objects That Generate Other Objects
1. Button - Generates a fly when pressed.
2. Cabinet - Generates a cockroach when fully opened after being fully closed.
Animated Models
1. Ant - Has a movement animation and a walking animation.
2. Fly (Near Trash) - Has a movement animation and a flying animation.
The scene includes a point light near the table containing the beetle, the fly swatter, and the ladybug, a point light near the picnic area, and two point lights upstairs below the only fluorescent light model.
In the simulator, the user’s view, the left controller, and the right controller have to be swapped between and moved individually using the WASD keys and the mouse. Controllers move automatically with the camera when moving or rotating the user’s view in the simulator. For moving a controller, the mouse is used to rotate the controller and the keyboard is used to translate the controller. The keyboard and mouse controls for positioning a controller are difficult to use because the direction and position of the controller in 3D space is unclear when viewing the scene with a 2D view.
In the headset, the camera view and each controller can be moved simultaneously just from the user moving around their head and hands. Controller and view positioning is more intuitive in the headset because it involves physically moving with the corresponding part of the body and does not require aiming each controller. Holding down a trigger to grab an object in the headset is also more natural than holding left click in the simulator. Having control over both hands is another major difference between interaction in the simulator and the headset. For example, using a headset in my scene, the user can move the fly swatter in their left hand while pressing the button that spawns flies with their right hand. This behavior can be somewhat replicated in the simulator when the user has camera control, but each hand is not moving independently.
In the simulator, it can be difficult to tell where a controller is in relation to an interactable object, meaning that it is hard to position the controllers to pick up or interact with an object. A controller clipping into an object can indicate that the controller is touching that object. However, when an interactable object happens to line up with the position of one of the controllers while the user is controlling the camera view, then it is easy to interact with that object because the user can just left click to interact. For example, the cabinet in my scene can be interacted without having to move the controller by moving the view over to the cabinet, positioning a controller on the left side of the cabinet, holding left click, and moving to open or close the cabinet.
It is natural in the headset to get a sense of how big an object should be because it can be seen in 3D relative to the height of the user. How big an object should be in the headset is difficult to gauge in the simulator because the 3D scale the object will have is difficult to determine from a 2D image. In the simulator, the user cannot move their view vertically. This limitation makes closely looking at objects that are above or below the camera’s view impossible. In the headset, the user can move their head downward and get a closer view of an object in the scene, such as the crumpled paper or ant in my scene.
This resources from the internet are also in the repository files:
UFO Model by hana on 3D Warehouse - https://3dwarehouse.sketchup.com/model/273a556e078133532296d88107d065f6/UFO
UFO Sound by Daniel Simion on SoundBible - https://soundbible.com/2213-Alien-Spaceship-UFO.html
Cow Model by Max M. on 3D Warehouse - https://3dwarehouse.sketchup.com/model/288b4047-1c6b-43e5-9b76-eb14ff9152fa/Cow
Roswell Logo from the Roswell New Mexico site - https://roswell-nm.gov/FormCenter/Convention-Civic-Center-9/Submit-a-Community-Event-53
Bounce Sound by Mike Koenig on SoundBible - https://soundbible.com/1120-Bounce.html
Mars Texture from NASA - https://nasa3d.arc.nasa.gov/detail/mar0kuu2
Typing on Keyboard Sound from SoundBible - https://soundbible.com/358-Typing-On-Computer-Keyboard.html
Office Chairs and Tables from Allsteel - https://www.allsteeloffice.com/design-resources/resources/2d-3d-models?brand=Allsteel
Avatar Idle Animation from Mixamo