Search Unity

NavMeshSurface or NavMeshAgent agentTypeId can't be on runtime

Discussion in 'Navigation' started by OmeGa-CinoS, Nov 26, 2020.

  1. OmeGa-CinoS

    OmeGa-CinoS

    Joined:
    Sep 30, 2016
    Posts:
    1
    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 :



    and



    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)