Search Unity

Problems with NavMeshAgent and RigidBody

Discussion in 'Navigation' started by SSStiven, Apr 18, 2019.

  1. SSStiven

    SSStiven

    Joined:
    Aug 9, 2016
    Posts:
    11
    Hi, I'm trying to create a simple game to learn about the Unity system for Pathfinding and Physics. I want to simulate 3 o 4 cars following his own path, and when a collision occurs every car stops following its path, and the physics make its work. Each path was found using a unique baked NavMesh and a each car has a NavMeshAgent Component (I don't need Obstacle Avoidance). I have found some problems:

    1) The cars aren't like Cylinders, but the NavMeshAgent ask me for a radius, how can I get a better NavMesh for my cars?

    2) I want a realistic turning on the corners, any recommendation?

    3) Should I disable the NavMeshAgent after the collision or before?

    Any advice, reference, book, article, etc will be very appreciated.
     
  2. Yandalf

    Yandalf

    Joined:
    Feb 11, 2014
    Posts:
    491
    Unity's NavMesh system unfortunately has no way of using non-cyllindrical shapes to represent its agents. However, with a simple road plan you wouldn't need an accurate shape for your agent to begin with.
    Likewise, you'll have to put in more legwork for realistic turns, the NavMeshAgents are simply not built for this.
    There are a few threads on similar topics around here, if I google around. No immediate "easy" solution pops up though.