Created a script to spawn an object at the mouse position on mouse fire but there's an error I don't understand

I assume it’s related to the fact that mouse coordinates don’t have a Z value and the game world does, but I saw that coming so I set the Z coordinates to 0.0 but it doesn’t work. I’m fairly new to programming so I’m sorry if it was something obvious.

Here’s the error

Here’s my code

function Update ()
{
	Input.GetKeyDown(KeyCode.Mouse0);
	{
		//if(Marker != null)
		//{
		//	Marker = null;
		//}
		
		var marker = GameObject.Find("Marker");
		
		var mousePos = Input.mousePosition;
		mousePos.Z = 0.0;
		var markerPos = Camera.current.ScreenToWorldPoint(mousePos);
		
		Instantiate(marker, markerPos, Quaternion.identity);
		
		
	}
	
}

The problem is on line 13. mousePos is a Vector3. A Vector3 has a ‘z’ field (lower case), but you are attempt to access ‘Z’ (upper case). Note that for ScreenToWorldPoint() the ‘z’ parameter should be set to the distance in front of the camera to generate the point. For a perspective camera, setting ‘z’ to 0.0 will cause the function to always return the camera position no matter where the mouse is on the screen.