weird rotation with navmesh agent

hi guyz, m trying to make a sea battle with AI and Player, that black flag ship is AI and other one is player. (In this video attached below) mine problem is that i want smooth look rotation at player by AI ship but m trying to make it happen from its right direction instead forward a little bit success after googling alot but still theirs a bug whenever i get near AI ship it rotate weirdly also some times it get rotation on Z axis like its falling backward but i want it to rotate just on y axis so its X axis faces where player is located m using this line for rotation

transform.right = ((Target.transform.position - new Vector3 (0, 4, 0) ) - transform.position).normalized;

plz watch video, i hope it will explain better thnx in advance

or any one can tell me how can i make this behavior smoothly with AI that right side of AI ship face player ship so it can shoot it with its cannon like in most sea battle…? without ship get tilt in target’s look at position (sry if its a noob question since m not much experienced unity programmer) m having problem with target look at mostly while programming for all enemies they just don’t focus on player correctly they get tilt back way or behave like that in upper video…

heres whole script m using if it can help : -

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.AI;
using UnityEngine.UI;

public class ShipAi : MonoBehaviour {

    public GameObject Target;
    private NavMeshAgent agent;

    public float CurrentDistanceToTarget;
    public Text DistanceToTarget;
    public float SafeDistance = 10;
    [Space]

    private RaycastHit hit;
    public float MaxRayDistance;
    public LayerMask TargetLayer;
    public Transform RayPoint; //point from where raycast will get casted also box cast

    [Space]
    public GameObject CannonBallPrefab;
    public Transform [] AttackPoints;
    public float AttackAcuracy;
    public float NextAttack;

    [Space]
    public GameObject LookAtTarget;

    // Use this for initialization
    void Start () {

        agent = GetComponent <NavMeshAgent> ();
    }
   
    // Update is called once per frame
    void FixedUpdate ()
    {       
        LookForTarget ();
        Chase ();
        DisplayTargetDistance ();
        Shoot ();
    }

    void DisplayTargetDistance ()
    {
        if (Target != null)
        {
            GameObject Player =    GameObject.FindGameObjectWithTag ("Player");
            CurrentDistanceToTarget = Vector3.Distance (transform.position, Player.transform.position);
            DistanceToTarget = GameObject.Find ("Target Distance").GetComponent<Text> ();
            DistanceToTarget.text = ""+ CurrentDistanceToTarget;


        }
    }

    void LookForTarget ()
    {       
        Target = GameObject.FindGameObjectWithTag ("PlayerShip");
    }

    void Chase ()
    {
        if (Target != null)
        {           
            if (Vector3.Distance (transform.position, Target.transform.position) > SafeDistance)
            {
                agent.SetDestination (Target.transform.position);
                agent.isStopped = false;
            }
            else

                if (Vector3.Distance (transform.position, Target.transform.position) < SafeDistance)
                {
                    agent.isStopped = true;
                    GetRdyToShoot ();
                    CheckifSomethingStillThr ();
                //    Debug.Log ("agent Stoped");
                }           
               
        }
    }

    void GetRdyToShoot ()
    {       
        LookAtTarget = GameObject.Find ("SeaEagle");
        transform.right = ((LookAtTarget.transform.position - new Vector3 (0, 4, 0) ) - transform.position).normalized;
    //    transform.right = (new Vector3(LookAtTarget.transform.position.x, LookAtTarget.transform.position.y, LookAtTarget.transform.position.z));
    }

    void Shoot()
    {
        if (Physics.Raycast (transform.position, transform.right,out hit, MaxRayDistance, TargetLayer))
        {
            StartShooting ();
            Debug.Log ("SingleRaycast got something and it is " + hit.collider.name);
        }
    }

    void CheckifSomethingStillThr ()
    {
        if (Physics.BoxCast (RayPoint.position,new Vector3(5, 5),transform.right, out hit))
        {
            //Debug.Log ("BoxCastGotSomething and it is " + hit.collider.name);
            if (hit.collider.CompareTag ("PlayerShip") || hit.collider.CompareTag("Player"))
            {
                Debug.Log ("BoxCastGotSomething and it is " + hit.collider.name);
                StartShooting ();
            }
        }
    }

    void StartShooting ()
    {
        if (Time.time > NextAttack)
        {
            NextAttack = Time.time + AttackAcuracy;
            foreach (Transform point in AttackPoints)
            {
                var Go = GameObject.Instantiate (CannonBallPrefab, point.transform.position, point.transform.rotation);
            }
        }

    }
}

Sry for Wall of Texts since i doono wats Generating this problem