cannot get NavMesh.SamplePosition to equal true....

mouseClick = Camera.main.ScreenPointToRay(Input.mousePosition);

		//mouse hits agro sphere trigger...must use layermask
		if (Physics.Raycast(mouseClick, out hit, 1000f, layerMask.value))
			cursorPosition = hit.point;

		NavMeshHit navHitPosition;

		// Set and move to target position
		bool navHitBool = NavMesh.SamplePosition(cursorPosition, out navHitPosition, 0.1f, 0);
		
		if (Input.GetMouseButton(0))
			agent.SetDestination(navHitPosition.position);
		
		if (Vector3.Distance(agent.destination, transform.position) <= 5)
			speed = 0;
		else
			speed = 1;
		anim.SetFloat(speedFloat, speed);

		Debug.Log(navHitBool.ToString());

I’ve found it’s best to just not even use navhitpositioned and removed the whole idea got it to work fine. seems like pointless feature.