Skip to content

Implemented a mini-golf simulator for the Meta Quest 1 and 2 where the user can build and play mini golf in the Stony Brook campus. They can choose the mini-golf tiles using an UI and also roam around the campus.

Notifications You must be signed in to change notification settings

Prateek-27/VR-MiniGolf

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Virtual Reality

Advanced VR

Name: Prateek Sengar

Project Download Link

Project Demo Video


In this assignment, I implemented a mini-golf simulator where the user can build and play mini golf in the Stony Brook campus subsection that I created in Assignment 1. The user can choose between the following three modes:

  • Navigation Mode: The user can effortlessly move around the area.
  • Build Mode: Create a mini-golf course by setting up the necessary elements on the ground.
  • Play Mode: Use your Build Mode to create a mini-golf course and play on it. The user should spawn on the campus map in Navigation Mode at the beginning.

Unity Version: 2020.3.25

Scene

As suggested, I reused the subsection of the campus I built for assignment 1 (Subsection: P (Heavy Engineering)) with the following additions. The user has the ability to travel around the campus, go in and out of the Heavy Engineering Building, and build and play golf anywhere on the campus (including inside the building!).

Switching Between Modes

1. Navigation Mode The user starts out in navigation mode and can travel around the map in the following ways:

  • Physical: The user can physically walk in the real world to make the character move.

  • Thumb-stick Navigation: By using the left thumb-stick, the user can traverse around the map.

  • Teleportation: By using the right thumb-stick, the user’s right-hand controller shoots a bending ray that can help the user teleport between 1m to 10m.

    teleport1

    teleport2

2. Build Mode Start build mode by pressing the Y button on the left controller. This casts a ray from the left controller which can be used to position and rotate the tiles.

build

I have also implemented a UI for the selection of tiles. This UI can be turned on and off using the X button, and the UI window follows the player and orients itself in front of the user (even if the user moves around).

ui

spawn

The ray turns blue if there is a selectable tile, and when pressed, the trigger the tile appears and the tile is fully interactable (can be moved around, can be brought closer and sent further, can be rotated), and tiles can be grabbed using the left controller grip.

When placed on the ground, the tiles align perfectly as I have used a 2-D grid that has multiple colliders and handled the positioning of the tiles using some scripts.

place

Tiles I have implemented 10 tiles in total in which two are start and end tiles. Others are 4 grass tiles (plane, 1 bumper, 2 bumpers straight, 2 bumpers corner) and remaining 4 are the sand variants (having greater friction). The grass tiles are green, and the sand tiles are yellow. The blue tile is the start tile, and the tile with a hole (the one in the middle) is the hole tile.

tiles

Also, I added some birds for better immersion which travel in a constant path and have flying animations attached.

birds

3. Play Mode When the player is done building, they can play the mini-golf course they created by stepping on the start tile. When the user steps on the tile, there is a gold ball instantiated in the center of the tile and they are automatically placed near a golf ball with a gold stick in their right hand.

play

The player can hit the ball, and when the ball stops, the player is teleported right next to it for their next turn. When the ball is hit 3 times, the game is over, and the stick is removed from the player’s hands and a “Game Over” sound is played. When the ball goes into the hole, the stick gets removed, and the “Victory” sound is played suggesting that the player was successful in putting the ball in the hole.

Extra Credits

  1. I implemented the sand variants of the tiles.
  2. I implemented an advanced menu for the tile selection.

Hierarchy

hierarchy1

hierarchy2

References

  1. XR Interaction Toolkit [2.3.0] (Complete XR Origin Set Up Prefab, Scripts)
  2. Unity VR Game Basics 2022 by Fist Full of Shrimp: YouTube Playlist (Used Scripts for Ray Interactor and Teleportation)
  3. Justin P Barnett's YouTube Channel: YouTube Channel (Watched some of his videos for basics and teleportation)
  4. Grid System: YouTube Tutorial [Code Used]
  5. Free music and SFX collection: Unity Asset Store
  6. Egypt Pack – Eagle: Unity Asset Store
  7. Toon Furniture: Unity Asset Store
  8. Mobile Tree Package: Unity Asset Store
  9. Pro Builder Tool
  10. Materials and Channel Mixer

About

Implemented a mini-golf simulator for the Meta Quest 1 and 2 where the user can build and play mini golf in the Stony Brook campus. They can choose the mini-golf tiles using an UI and also roam around the campus.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published