Search Unity

Question How can I make the NavMeshAgent behave or rather move like a tank / vehicle?

Discussion in 'Navigation' started by Fragon_Gamer, Jan 8, 2023.

  1. Fragon_Gamer

    Fragon_Gamer

    Joined:
    Feb 21, 2020
    Posts:
    2
    Im sorry in advance if my question seems to vague, but some ressources on the topic would be great.

    After alot of hours spent, i still dont understand how to make the NavMeshAgent behave like a vehicle(so with thight turn angles, not sliding around etc...).

    The game I am working on is an RTS in with the mechanics like Company of Heroes and I would like to use Unitys AI package, because of the obstacle and agent avoidance.
     
  2. androvisuals_unity

    androvisuals_unity

    Joined:
    Mar 23, 2020
    Posts:
    47
    You'll just have to play around with the settings like auto brake and turning speed to name just two.
    It won't be realistic vehicle physics but you don't need that for a rts game ;-)
     
  3. Fragon_Gamer

    Fragon_Gamer

    Joined:
    Feb 21, 2020
    Posts:
    2
    Thanks for the reply. Alltough i have played with the values and i must say that i am a not really satisfied with this approach.
     
  4. androvisuals_unity

    androvisuals_unity

    Joined:
    Mar 23, 2020
    Posts:
    47
    Then try getting the velocity of the navagent and then using this to modify the turning speed and other properties on the fly.

    This would be "similar" to how vehicles move. A slower moving vehicle can turn tighter than a faster moving vehicle.
    Also use some Mathf.Clamp to limit the ranges.