create a gunTurretScript

hello,
i am trying to create a script to control my gunTurret and my problem is to lookAt(cross) with 2 diffrent objects: turret(y-Axis), Gun(x-Axis).
How could this work?
And what could be best to take as crosshair?

are you tring to get rotation from the main section of the turret and then the barrel moves up and down?

1 Answer

1

There are large number of turret questions that include scripts on this site, and even more for crosshairs. Here is a link to some turret code I posted awhile back:

http://answers.unity3d.com/questions/388185/make-the-turret-automatically-rotate-to-look-at-wh.html

Most of turret code uses Transform.LookAt() or Quaternion.LookRotation() to aim. They solve the X-Axis and Y-Axis issue by changing the values for the look point before pointing the turret/gun.

big thx :)