DemoProductions / shmup

3 stars 2 forks source link

add tracking ai and missile prefab #48

Closed flip40 closed 8 years ago

flip40 commented 8 years ago

Adds the TrackingAI class, which rotates the attached object to face the nearest target, it relies on the base Bullet functionality to provide its speed and other parameters (in other words, a missile is just a Bullet that also has tracking). Currently only targets the enemy objects, this will be changed once the Team class is added.

The class has two editor variables, Degrees Per Second (turning rate) and Tracking Radius. This can be set uniquely in the editor on prefabs to create missiles with unique tracking properties.

Also pretty gizmo drawing that displays the direction the missile is facing, it's target vector, and it's tracking radius.

39

ghost commented 8 years ago

Works great. Only thing is that the collider size of the missile didn't save for some reason. Will have to make a few changes later to get this working with the Weapon class