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.)
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);
}
}