Target Lookat not working . I want Z axis to rotate only.

Hello.
Right now , i am practicing making a 2D shooting game.

I want to make the enemy look at the Player by simply using Lookat program, but it only rotates for x ,y axis, which the 2D sprites looks winded up.
(as i look at the transform tab, it seems the y axis rotates seems to set to 90degrees.)

109643-trouble2.png
I do not know why this is happening.
I just want the enemy to rotate ony for Z axis
Could someone kindly help me how i could fix this issue??

Heres the code i have written down.
its quite simple.

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

public class chase : MonoBehaviour {

public Transform target;
void Update(){
	transform.LookAt (target, Vector3.right);

}

}

Vector3.right is the same as Vector3(1,0,0) which is the x axis.

I’m not familiar with 2D game creation in Unity but try Vector3.forward which is the same as Vector3(0,0,1).

I’m assuming you are using all 3 axis in your game which is why you need a Vector3 in the first place. Generally 2D games only use the X and Y axis, although depending on your game it can use a 3D environment if you want it to.

Thanks for your kind reply.
I have tried the Vector3.forward but didnt solve the problem.

The x axis moves only, and the y& z axis rotates -90degree.