Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Lock NavMeshAgent to X/Y Axis.

Discussion in 'Navigation' started by Razputin, Apr 12, 2021.

  1. Razputin

    Razputin

    Joined:
    Mar 31, 2013
    Posts:
    356
    Making a 2.5D game so I don't want my agents to move on the Z Axis. However when using things like NavMeshAgent.SetDestination() they will still walk around obstacles on the Z Axis.

    My current solution is to copy the terrain but only make it 1 unit wide, then bake this, while the rest of the terrain is just background.

    Current Solution :
    upload_2021-4-12_16-2-15.png
    Is there a better solution than this?

    Thanks!
     

    Attached Files:

  2. Razputin

    Razputin

    Joined:
    Mar 31, 2013
    Posts:
    356