Why does this not move my nave mesh agent?

Debug.Log ("moving");
            float xPos =  getMousePositionX();
            float zPos =  getMousePositionZ();
            Vector3 target = new Vector3(xPos, 0.61f, zPos);
            //Instantiate(targetObj, target, Quaternion.identity);
            selectedUnit.GetComponent<NavMeshAgent>().SetDestination(target);

This code, for some reason does not cause the nav mesh agent to move but if i place a object in the scene and tell it to move to that objects position it does but it won’t move to a specified Vector3 is there any way to do this?

Are speed and angularSpeed values correct? Are you sure xPos and zPos are on the navmesh? Is NavMeshAgent behaviour enabled with the correct navmesh linked?

yea the mouse pos is on the nav mesh and when i put a object in the same position it works. where would i check the speed value?
it should still be default

On the NavMeshAgent component in the inspector.

yea they are the same as default i even recreated the agent and it still did not work