Correct the angle of rotation ?

Updated on December 25, 2016 in Answers
Share on Facebook0Tweet about this on TwitterShare on Google+0Share on Reddit0
0 on December 25, 2016

My tank has a canon. When i get close, it points at me.
It points at me where ever i go. That’s what i don’t wont. It should only rotate around it self (like a fan) and not moves up and down when i jump.


Vector3 direction = target.position - transform.position;

Quaternion rotation = Quaternion.LookRotation(direction);

transform.rotation = rotation;

  • Liked by
Reply