|
I am trying to clean up some issues im having in my game. I use this script on my turret body it recognizes when the player gets in range, however the turret is reversed when i moves and looks at the player. So its the back of the turret that actually follows the player. How do i fix this? var target : Transform; var range : float; var speed : float; function Update () { range = Vector3.Distance(target.transform.position, transform.position); if (range<200) { transform.rotation = Quaternion.LookRotation(transform.position - target.position); } if (range<150) { transform.Translate(Vector3.forward*speed*2); } }
(comments are locked)
|
