Tilemap.GetTile not finding tile

Hello,

I am creating a 2D puzzle game using a hexagon tile map. I am just starting the project and I first want to be able to let the player move around by clicking on a tile to move to. However, when I click on a space where a tile is located, it cannot find that tile. I am wondering if there is something I’m overlooking or something is just not working. HasTile does not work either. Code:

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

public class PlayerMovement : MonoBehaviour
{
public Tilemap map;
public Vector3Int pos;

void Update()
{
if(Input.GetMouseButton(0)){
Vector3 mp = Camera.main.ScreenToWorldPoint(Input.mousePosition);
pos = map.WorldToCell(mp);
if (map.GetTile(pos)){
Debug.Log(“Tile”);
} else{
Debug.Log(“No Tile”);
}
}
}
}

Vector3 mp = Camera.main.ScreenToWorldPoint(Input.mousePosition);
mp.z = 0f;

Try adding that. The rest can stay the same.

Thank you very much