Launch Arc Rendering

It's been a solid two years since my last Physics class. Do I even still remember how math works?

Believe it or not, I've recently learned it can be quite annoying trying to aim something without some type of sight to go by. I figured the simplest solution would be something that draws a line matching the physics of the projectile. I used this youtube tutorial and this wiki page for the formula and techniques needed.

For the most part that video covered everything. My biggest problem was that it assumed a fixed hight and I needed it to be variable. So, to make this work I first made the "ground level" in the game be the Y world point of zero. From there, I used the original formula from the wiki page to handle the height displacement.

The final icing on the cake was to just make sure that the arc line would be redrawn whenever the player moved the trap. This just required making a call to the scripts calculate method whenever the trap was actively being dragged. Et Voila! We now have an aiming mechanism for the cannon trap!