Rotation to the vector does not work

I created simple model with “chassis” and “turret” attached at the top (as a child). I’m trying to aim the turret at the target. And it does not work (turret turns in wrong direction and angle). What am I doing wrong?

Vector3 enemyPos = enemy.transform.position;
enemyPos.y = transform.position.y;  //target position is middle of chassis and I do not want to lower my aiming point
Vector3 fromTo = enemyPos - transform.position;
rotationToTheTarget = Quaternion.LookRotation(fromTo);
transform.rotation = rotationToTheTarget;

Maybe I got your question wrong, but if you’re trying to make a GameObject look at another one you can use transform.LookAt (C#):

	public GameObject target; // then you assign it in the Inspector

	void Update () {
		transform.LookAt(target.transform);
	}

JavaScript:

    public var target:GameObject; // then you assign it in the Inspector
    
    function Update () {
    	transform.LookAt(target.transform);
    }