Finding Initial Velocity Given Angle and Destination

A physics problem typically involves using a given angle and velocity to determine where a projectile lands. This is all well and good, but when working on a game with projectiles, you already know where it should land and at what angle it should be launched. This article shows the…

Particular Problems with Public Variables in Unity

The Unity documentation [http://docs.unity3d.com/Documentation/Manual/Scripting.html] it indicates that all public variables are made available in the inspector for direct editing. While this is handy, it is also dangerous. This article will cover a few things regarding public variables, and how to avoid them in…

Avoiding Long Compile Times

Long compile times are a real chore when it comes to testing things. It is especially cumbersome when all you are doing is making small edits resulting in 2 seconds worth of editing, and 2 minutes waiting for compiling. Problem One place where this is particularly the case is shader…

Finite State Machines

To expand on my post about enumerations [http://www.plantingcode.me/2012/11/02/enumerate-enumerate/earlier] I'm going to look at Finite State Machines in a relatively general sense. Let's start with breaking down what exactly a Finite State Machine is. We can look at the descriptive words to see…

Important Notes on Touch Input in Unity

There are a few things that you will want to keep in mind when working with touch in Unity. Mobile devices pass click events with their touch events, platform dependent compilation, rotations are a special type all their own, sometimes Unity hands back one thing when you need another, collisions…