I believe the NavMesh is not being placed in coordination with the sphere object would be my guess. This is the script the start of the script that I have on the sphere.
NavMeshAgent navMeshAgent;
public float timeForNewPath;
bool inCoRoutine;
void Start()
{
navMeshAgent = GetComponent<NavMeshAgent>();
// Find a valid position on the NavMesh
NavMeshHit hit;
if (NavMesh.SamplePosition(transform.position, out hit, 1.0f, NavMesh.AllAreas))
{
// If a valid position was found, move the agent to that position
navMeshAgent.Warp(hit.position);
}
else
{
Debug.LogError("No valid position on the NavMesh found close to the agent's starting position");
}
}
The else statement is always returned.
I am not sure what to do to get past this issue, any help is appreciated.