NavMeshSurface or NavMeshAgent agentTypeId can't be changed on runtime

Hello there!

I’ve been trying some dynamic change with path and agent. Basically I’m trying to make different groupe of people walk on their own navmesh. Each group have a different circuit at the same time so I go with NavMeshSurface to make one NavMeshSurface by group.
No problem for now, but when I’m creating group one after another and want to change NavMeshAgent agentID and NavMeshSurface agentID during runTime, Unity don’t understand it, and let this happen :



Someone have already try that? Or do you know what I need to do to change NavMeshSurface.agentTypeID?

I’m just doing NavMeshSurface.agentTypeID= int; but the only time it’s working it’s for humanoid (0 in the array)

your NavMeshAgent.agentTypeID = GameObject.FindGameObjectWithTag(tag where is NavMeshSurface).GetComponents()[index your NavMeshAgent’s name ].agentTypeID;