Turret Placement in Turret Defense Game

This script is used to place turrets on a grid of tiles. Everything works well until I place one turret. When I place one Turret it doesn’t let me place anymore, when I delete the turret while playing it will let me place one again. Any Idea why?

function Update ()
{
if(Input.GetMouseButton(0))
{
Debug.Log(“Cast Ray”);

	var hit : RaycastHit;

	var ray : Ray = Camera.main.ScreenPointToRay (Input.mousePosition);

		if (Physics.Raycast (ray, hit, 100.0))

		{Debug.Log("Hit");

			if(hit.collider.gameObject.tag == "EmptyTile")

			{
			hit.collider.gameObject.tag = "FullTile";

			Debug.Log("Hit Empty");

			var turretPos = hit.collider.gameObject.transform.position;

			Instantiate(doubleTurret,turretPos,Quaternion.identity);
			
			}
		
		}
	}
	

}

I’ll just answer this myself I guess. The problem was that when I instantiated My Turret it had a large sphere collider on it that blocked the ray from hitting the tile. I just added a layer for tile collison and set the ray to ignore all other layers.

This helped me figure out how to setup a layer mask for a Ray cast.