DemoProductions / shmup

3 stars 2 forks source link

finally fix trackingAI properly #144

Closed flip40 closed 7 years ago

flip40 commented 7 years ago

Working on AICommands I accidentally stumbled upon tracking being broken again. Not sure if somehow the AICommands changes triggered the issue, but I was starting to see odd rotations, breaking my last patch.

I think I have fixed it for good this time, removing the old patch and changing Vector3.forward to transform.forward. I wish I had realized this sooner, but Vector3.forward was a global vector, and not affected by the object rotation. This led to the backwards behavior under rotations. Now that it is using transform.forward, the vector rotates with the object.