Unity doesn't recognize NavMesh.SamplePosition() static function... ?!

Hi everebody! I tried to write a function in my script to set a random position where my NavMeshAgent must go within a pre-defined area using NavMesh.SamplePosition() but the console display show me this error:

error CS0117: 'NavMesh' does not contain a definition for 'Sample Position

Why? Can anyone help me? Thanks everybody

ps this is the documentation of NavMesh.SamplePosition() : http://docs.unity3d.com/ScriptReference/NavMesh.SamplePosition.html

If you would paste your code in your question it would be easier to find the error and help you.

Here’s my code:

.
.
.
.
.

Vector3 point;
if (RandWaypoint (transform.position, findRangeArea, out point)) {
	nav.SetDestination (point);
}

.
.
.
.
.

bool RandWaypoint(Vector3 center, float range, out Vector3 pointR) {
		for (int i = 0; i < range; i++) {
			Vector3 randPoint = center + Random.insideUnitSphere * range;
			NavMeshHit hit;
			if (NavMesh.SamplePosition(randPoint, out hit, 1.0f, NavMesh.AllAreas)) {
				pointR = hit.position;
				return true;
			}
		}
		pointR = Vector3.zero;
		return false;
	}