Search Unity

Is it possible to use NavMesh on a game like volleyball?

Discussion in 'Navigation' started by unkopath, Dec 22, 2019.

  1. unkopath

    unkopath

    Joined:
    Jun 23, 2018
    Posts:
    19
    Hi, is it possible to use Navmesh for a game like volleyball?

    Imagine having two navmesh agents: NavMeshAgent1 NavMeshAgent2

    Then two navMeshes NavMesh1 NavMesh2

    Is it possible to have NavMeshAgent1 only walk on NavMesh1 and NavMeshAgent2 on NavMesh2?

    I don't want to use the same navmesh for both agents because I don't want one player be able to walk in other player zone, and also would like to use methods that can give me a random position inside my area not in player area
     
  2. Karrzun

    Karrzun

    Joined:
    Oct 26, 2017
    Posts:
    129
    Yes, that should be possible. When baking your NavMesh you can define and assign different areas. Then, when searching for a spot to navigate to, your agents can use a areaMask to only include their own area(s). It's still one NavMesh, though.