My transform.lookat is making my enemy invisible.

The enemy character i am wanting to implement in my game is acting weird when i put in the transform.lookat function, it makes the enemy invisible and the object still exists within the game, the z axis doesnt change and it doesnt disable the object.

public float speed;
private Transform target;

// Start is called before the first frame update
void Start()
{

    target = GameObject.FindGameObjectWithTag("Player").GetComponent<Transform>();
    

}

// Update is called once per frame
void Update()
{

    transform.position = Vector2.MoveTowards(transform.position, target.position, speed * Time.deltaTime);
    transform.LookAt(target);

}

void OnTriggerEnter2D(Collider2D other)
{

    if (other.gameObject.CompareTag("Bullet"))
    {

        Destroy(gameObject);
        Destroy(other.gameObject);

    }
       
        

}

The sprite is probably just looking sideways. Think of looking at the thin edge of a piece of paper. It will appear to disappear. Just go into 3D mode whilst playing and see in the scene view what’s going on. You can adjust the rotation there.