Monday 29 February 2016

Next Gen 25/02/16 Coding and Aiming Control

This week we learned how to use basic targeting in unity. The way the targeting worked was that firstly we created a basic turret looking shape (by combing a cylinder with a sphere) facing a basic cube (that acted as the player). The coding that was then used dubbed the cube as the target and then ordered the turret to follow the cube on both the x and y axis of unity (since unity is a left handed system, the x represents width and y represents height). Some of the code was created by using Pythagoras theorem and others by using cross products.


Once the game was activated the turret always followed the target, however it could not always keep up with the target completely, so it as some what slow and while it did follow the target we did not do anything extra to the turret so it could not do anything else.

We will be updating the functions in the future through other mathematics (finding magnitudes and vectors).

No comments:

Post a Comment