More Unity: Part 1 (Triggers and Timing)

My last post focused on working with terrain in Unity and figuring out how to import real life height maps to create 3-D models of terrain. Since then I have completed most of my work involving the Mount Lemmon terrain; however, I still have some work to do with finding a way to put a real life copy of the Mount Lemmon road onto my 3-D terrain. As my presentation deadline comes closer, I am trying to focus on the backbone of the project so the road might have to wait.

In this past week I have been working on timing and checkpoints. First I will give a little background so you understand where this comes into place with my project.

The objective of this project is to create a virtual reality game by taking inputs from a bike trainer. The game will render a 3-D scenario such as riding a bicycle on the Mount Lemmon road so the user can be given an experience similar to a real life one. One of the goals of this project is to be able to save times and checkpoints so the user can then train against previous times. Much like how somebody could’ve ran an eight minute mile a month ago but because of constant training can now run a seven minute mile.

Ordinarily, the task of saving previous times would’ve been a walk in the park but because I am using a programming language which I only have a babies grasp on, this task has proved to be challenging. The first step was to find an easy way to time the user every meter. At first, I had no clue as to how to do this but after a couple minutes with my adviser (who is familiar with Unity) I had the problem solved. 3-D objects in Unity can be “triggers” which means that when another object touched them they can trigger something. I used this neat feature in my roll-a-ball scenario to test it out and it worked fabulously. I used a cube as the trigger and told the cube that every time my ball touched it to print out the time in the console. And sure enough, it worked like a charm. To be continued…

I don’t want this blog post to get too long so I will be writing another post shortly which will cover part two of my Unity adventures.

 

 

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s