Turret targeting is wrong

Ok, my problem is thet turrets do not target right spot.

Heres how it looks

And here is my code:

function TurretRotation()
{
	var MountThisFrameRotation : Quaternion;
	var MountCurnetLocalRotation : Quaternion;
	var MountTargetLocalRotation : Quaternion;
	var MountTargetRotation : Quaternion;
	var TooFar : boolean;
	var TargetPosition : Vector3 = Target.transform.position;
	if (Target != null)
	{
		MountCurnetLocalRotation = transform.localRotation;
    	transform.LookAt(TargetPosition);
    	transform.localRotation.x = 0;
		MountTargetLocalRotation = transform.localRotation;
		transform.localRotation = MountCurnetLocalRotation;
		TooFar = LogicClampAngle(MountTargetLocalRotation, TurretMountStartingRotation, -180, 180, MinimumY, MaximumY, -180, 180);
	}
	if (Target != null && Target.GetComponent(Stats) != null && Target.tag != ThisGameObject.tag && !TooFar)
		MountThisFrameRotation = Quaternion.RotateTowards(transform.localRotation, MountTargetLocalRotation, TurnSpeed * Time.deltaTime);
	else
		MountThisFrameRotation = Quaternion.RotateTowards(transform.localRotation, TurretMountStartingRotation,  TurnSpeed * Time.deltaTime);
	if (MountThisFrameRotation != transform.localRotation)
		transform.localRotation = MountThisFrameRotation;
	

	var TowerThisFrameRotation : Quaternion;
	var TowerCurnetLocalRotation : Quaternion;
	var TowerTargetLocalRotation : Quaternion;
	var TowerTargetRotation : Quaternion;
	if (Target != null)
	{
		TowerCurnetLocalRotation = TurretTower.transform.localRotation;
  		TurretTower.transform.LookAt(TargetPosition);
  		TurretTower.transform.localRotation.y = 0;
		TowerTargetLocalRotation = TurretTower.transform.localRotation;
		TurretTower.transform.localRotation = TowerCurnetLocalRotation;
		if (!TooFar)
			TooFar = LogicClampAngle(TowerTargetLocalRotation, TurretMountStartingRotation, MinimumX, MaximumX, -180, 180, -180, 180);
	}
	if (Target != null && Target.GetComponent(Stats) != null && Target.tag != ThisGameObject.tag && !TooFar)
		TowerThisFrameRotation = Quaternion.RotateTowards(TurretTower.transform.localRotation, TowerTargetLocalRotation, TurnSpeed * Time.deltaTime);
	else
		TowerThisFrameRotation = Quaternion.RotateTowards(TurretTower.transform.localRotation, TurretTowerStartingRotation,  TurnSpeed * Time.deltaTime);
	if (TowerThisFrameRotation != TurretTower.transform.localRotation)
		TurretTower.transform.localRotation = TowerThisFrameRotation;
}

LogicClampAngle - is a function thet returns true or false depending on if target is in fireing arc.

Thx i did not realaze i was working with quanternions. Evrything works perfect.
Here is a new script if anyone needs it:

function TurretRotation()
{
	var MountThisFrameRotation : Quaternion;
	var MountCurnetLocalRotation : Quaternion;
	var MountTargetLocalRotation : Quaternion;
	var MountTargetRotation : Quaternion;
	var TooFar : boolean;
	var TargetPosition : Vector3 = Target.transform.position;
	if (Target != null)
	{
		MountCurnetLocalRotation = transform.localRotation;
    	transform.LookAt(TargetPosition);
    	transform.localRotation = Quaternion.Euler(0,transform.localRotation.eulerAngles.y, 0);
		MountTargetLocalRotation = transform.localRotation;
		transform.localRotation = MountCurnetLocalRotation;
		TooFar = LogicClampAngle(MountTargetLocalRotation, TurretMountStartingRotation, -180, 180, MinimumY, MaximumY, -180, 180);
	}
	if (Target != null && Target.GetComponent(Stats) != null && Target.tag != ThisGameObject.tag && !TooFar)
		MountThisFrameRotation = Quaternion.RotateTowards(transform.localRotation, MountTargetLocalRotation, TurnSpeed * Time.deltaTime);
	else
		MountThisFrameRotation = Quaternion.RotateTowards(transform.localRotation, TurretMountStartingRotation,  TurnSpeed * Time.deltaTime);
	if (MountThisFrameRotation != transform.localRotation)
		transform.localRotation = MountThisFrameRotation;
	

	var TowerThisFrameRotation : Quaternion;
	var TowerCurnetLocalRotation : Quaternion;
	var TowerTargetLocalRotation : Quaternion;
	var TowerTargetRotation : Quaternion;
	if (Target != null)
	{
		TowerCurnetLocalRotation = TurretTower.transform.localRotation;
  		TurretTower.transform.LookAt(TargetPosition);
  		TurretTower.transform.localRotation = Quaternion.Euler(TurretTower.transform.localRotation.eulerAngles.x,0, 0);
		TowerTargetLocalRotation = TurretTower.transform.localRotation;
		TurretTower.transform.localRotation = TowerCurnetLocalRotation;
		if (!TooFar)
			TooFar = LogicClampAngle(TowerTargetLocalRotation, TurretMountStartingRotation, MinimumX, MaximumX, -180, 180, -180, 180);
	}
	if (Target != null && Target.GetComponent(Stats) != null && Target.tag != ThisGameObject.tag && !TooFar)
		TowerThisFrameRotation = Quaternion.RotateTowards(TurretTower.transform.localRotation, TowerTargetLocalRotation, TurnSpeed * Time.deltaTime);
	else
		TowerThisFrameRotation = Quaternion.RotateTowards(TurretTower.transform.localRotation, TurretTowerStartingRotation,  TurnSpeed * Time.deltaTime);
	if (TowerThisFrameRotation != TurretTower.transform.localRotation)
		TurretTower.transform.localRotation = TowerThisFrameRotation;
}