On this page you can find the entire progress of Spear Shot. This project falls under my Creative VR Portfolio.
Here are some previews!
Spear shot was inspired by a new hobby that I began before pursing graduate school. The summer after I finished my undergraduate degree, I began diving. I enjoy the sport because it brings me peace and offers a relaxing respite from reality.
For my creative VR Portfolio project, I wanted to create an experience that was relaxing but I also wanted to make a fun and educational game out of it, while inspiring people to explore the ocean.
Follow along to see how I turned a typical FPS game into a spearfisher’s dream!!! I use VR to enhance spearfishing and eliminate the actual limits of the sport while creating an immersive experience. As the limits in VR are endless, I enable the user to have an unlimited breath hold and shoot fish from all over the world, in just one scene! But… it gets even better, this is not just a game, Spear Shot will educate the users about the fish that they have shot and provide details about their natural habitat!
Follow along to see my journey though Spear Shot!
Diving Inspiration
Planning
My first powerpoint and vision
Chart for staying on track and time…
Here is a chart displaying my Game play mechanics.
Mechanics:
- Main menu with boat and instructions
- Shooting Spear Gun
- Continuous Movement/snap rotation
- Cards with information about fish
- Find the treasure
- Shark attack – Game over!
Shooting Gun
I built a working gun by starting with a machine gun tutorial that I followed on YouTube.
I finished the tutorial and had a working machine gun that shot stationary targets. Next, I replaced the machine gun with a spear gun model that I found here:
I added color to the model and changed the areas that the user could grab to fit the spear gun instead. as shown here…
After I had a spear gun shooting, my next step was to adjust the bullet from an automatic shot of bullets, to a semi automatic shot of spears.
I used my projectile script to adjust the shooting on trigger to produce one projectile at a time rather than consistent shooting if the user holds down the button. Here is the code I used:
Finally I changed the bullets to arrows and this is what it looks like!
Trouble shooting
As easy as it sounds, I did run into some issues that I did not expect. The issues included:
- The spear projecting vertically instead of horizontally
- The spear colliding with the barrel
- The spear not projecting at all and rather just coming out of the gun and staying in place
Teleporting
I used XR toolkit to enable continuous movement for my player. The user uses the joysticks on the left controller to walk and the joystick on the right side for snap turning. This movement mechanism was relatively simple although I did run into the issue at first where my player could not hold the gun while moving. Later, I realized that this was because I originally programmed the user to drop the gun when the hand is too far away from the speargun object. To debug this issue, I changed the area in which the user drops the gun to 5000 units and problem solved. The user is now able to move with the gun!
Fish Information Cards
After testing different methods of revealing the information cards, my classmates and tutors help me decide that a physical fish card that the user could pick up was the best option. The reason being, the way I originally had this mechanism working is that when the player shot a fish, the card would spawn and be attached to the viewers XR rig, that way the card would follow their line of view. However, with testing, I found that many people found this disorienting and did not know how to delete the card. I later changed it so the fish information icons would be more comparable to playing cards. Thus, the playing card would generate in front of the user when the fish is shot and the user could pick up the card and look at it. On the front, the user sees a “congrats… you shot a ____” along with their fish and if the user turns the card over they see the fish’s habitat, adding an educational asset to my game. At the end of the game the user could look back and see all of the fish in my game.
Find the treasure
The goal of my game is to shoot all of the fish and find the treasure chest. Once the user collides with the chest, the shark animation is triggered and begins its attack. The shark attack begins with scary music and the user is distracted by shooting inside the ship, there are targets and bottles to shoot, then when the shark is shot, the game ends.
Sound Effects
I used audio to enhance my game. The addition of audio took this experience to the next level. I added a constant background noise of an underwater audio player that I got from Freesounds.com. Also from the same website, I was able to find audio for when the gun is shot and when a fish is hit. On the Barracuda fish I put the song Barracuda!!!! The way that I added sound was by adding an audio listener to my scene, then I added an audio source to the fish and added a few lines of code UI card so that when the fish is shot and the UI appears with the fish card the audio would be played. Here is the code that I tried first but it did not work because the sound was being destroyed when the spear collided with the fish.
Starting menu & instructions
I used an asset that I got from the asset store to create a start menu on a boat! The player begins on a boat with ocean noise surrounding them and then they press the dive button to begin diving.
I programmed the dive button to be an interactive button by switching scenes using a line of code to access the scene manager and go to the dive scene.
Instructions are also added by simple UI menus in Unity to tell the player how to play the game.
When the user presses the red dive button, they begin their dive.
Shark Attack animation & GAME OVER
I created this scene with an XR rig, 3D text, blood splatter from Unity’s Asset store and an under the sea sky box.