Should turret always hit a target or sometimes to miss ? And how to fix the wrong axis forward ?

My main goal in the end is to create enemies let’s say 3d cubes coming in waves randomly to the turret trying to attack it from many directions and the turret should try to shoot the enemies.

I wonder if the turret ai logic is to hit all the time the target/s or sometimes it should miss and the targets should have some ai to try to avoid the turret weapon ?

The other problem is that the turret model axis seems to be wrong. The blue axis is facing forward but the gun of the turret is facing the red axis instead the blue. I tried to put the whole turret under a empty gameobject but it didn’t change much. I created empty gameobject and dragged the turret under it as child but it didn’t fix the problem.

This is a screenshot of the turret constructor in the hierarchy with the enemy 3d cube :

The blue axis is facing the target but the gun that should shoot is on the red axis.
This axis problem I think also make the turret child to rotate wrong.

This is the script attached to the Sentry_Turn_01 gameobject. :

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Turn_Move : MonoBehaviour 
{
    public int TurnX;
    public int TurnY;
    public int TurnZ;
    public int MoveX;
    public int MoveY;
    public int MoveZ;
    public bool World;

    private GameObject target;

    // Use this for initialization
    void Start()
    {
       target = GameObject.FindGameObjectWithTag("Enemy");
    }
    // Update is called once per frame
    void Update()
    {
        transform.LookAt(target.transform);

        /*if (World == true)
        {
            transform.Rotate(TurnX * Time.deltaTime, TurnY * Time.deltaTime, TurnZ * Time.deltaTime, Space.World);
            transform.Translate(MoveX * Time.deltaTime, MoveY * Time.deltaTime, MoveZ * Time.deltaTime, Space.World);
        }
        else
        {
            transform.Rotate(TurnX * Time.deltaTime, TurnY * Time.deltaTime, TurnZ * Time.deltaTime, Space.Self);
            transform.Translate(MoveX * Time.deltaTime, MoveY * Time.deltaTime, MoveZ * Time.deltaTime, Space.Self);
        }*/
    }
}

The original code in this script was just rotating the Sentry_Turn_01 on the Y and it was working fine.
Now I’m trying to use LookAt and since the axis are wrong it’s not working good.

I’m also not sure if just LookAt is a good or the right ai logic for a turret but first I need to fix the axis problem.

As for the first question, whether a turret has guaranteed hit or not, that’s entirely a game design decision for you to make. Try one, try the other, see what you like best.

As for the question about rotation, here is a post I made about Turret aiming/rotating:

In general when you want an axis other than +Z to face somewhere, you put the thing you want as a child of another GameObject and rotate that other GameObject.