Building a Virtual Reality Experience: VR Motorcycle Race
Virtual reality is a computer-generated simulation or world where your entire view is virtual. We can manipulate this virtual world and do some really amazing things. This is a project I built for the Google Cardboard in the Unity Game Engine, called VR Motorcycle Race. In this experience, the user is riding on a motorcycle and their objective is to avoid all of the objects on the path.
In this experience, the user is in a dusty and sandy environment and is challenged to avoid all of the objects. The user has to get to the finish line in the least amount of time that they can.
Breakdown of Gameplay
Environment
The experience starts in the sandy environment on the road, and the user is shown the time. The user has to turn their head to avoid all of the objects. If they hit an object, they will automatically slow down for two seconds. The user’s time will be displayed when they cross the finish line.
Obstacles
Obstacles randomly appear on the road while the player is moving forwards. The three obstacles in this game are stop signs, cows, and barrels. These objects cover a part of the road so that the user has to move their head to avoid them.
Movement
The player moves automatically on the road, and they get faster and faster until they hit an obstacle. When an obstacle is hit, the player slows down for 2 seconds, and then starts getting faster again.
Game Mechanics
Randomization of Obstacles
The objects are randomly selected and are randomly put on the road.
The highlighted line uses “Random.Range” to randomly select one of the objects.
The highlighted line shows uses “Random.Range” to select an x value to place the object on the road.
Movement
This shows the values of the movement of the player. The player accelerated at a speed of 0.5 with a maximum of 10. When the player hits an obstacle, it slows down to a speed of 0.25 for two seconds, and then starts accelerating again.