I need to rotate a turret around the Z axis. The turret is successfully rotating around the z axis however, the turrets x rotation becomes 0 when it should stay at -90, and i cannot figure out how to rotate the turret and keep the x rotation at -90.
Here is the code i have to rotate the turret.`public class PT_Turret_rotate : MonoBehaviour
{
public GameObject player;
private Vector3 lookDir;
private void Update()
{
lookDir = player.transform.position - transform.position;
lookDir.y = 0;
transform.rotation = Quaternion.LookRotation(lookDir);
}