Skip to content
August 29, 2014 / CoffeeCoder

Unity Physics are pretty dang epic!

I have made some pretty good progress with some of the basic game mechanics for “Project: Roll-Away!”, as the project name has been changed.

I have a basic scoring system, as well as collection systems and “death routines” in place. Checkpoints and initial spawnpoints also work flawlessly.

As I sat working yesterday, I realized I wanted a way to make it appear as though things like gems and checkpoint flags were hovering, in order to catch the player’s eye. I initially attempted to “lerp” between two positions, but this didn’t give exactly the effect I was going for. Then I remembered a trick from an old video tutorial, about using triggers and Unity’s physics engine to make objects “hover” by utilizing the “AddForce” function. I tried it, and it gave me EXACTLY what I was looking for!

Here is a video showing what I mean!



I also added a limiter, so that the object wouldn’t gain enough force to bounce out of the bounds of the trigger and fly out of the level, because upon initial tests, exactly that happened!

Here’s a screenshot showing some of the behind-the-scenes magic:
Trigger zones everywhere!

And that, my friends, will enable me to quickly get this game… rolling! I just have to finish off the basics of the “Player Control” script, which includes adding “save points” in the game so that the player can save anywhere it’s allowed, and finish writing the Save Game and Load Game routines, and it should be playable sooner rather than later! I won’t make any promises on a demo release, but it will definitely be within a month or two, at most!

Stay tuned!

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

%d bloggers like this: