Search Unity

  1. The 2022.1 beta is now available for testing. To find out what's new, have a look at our 2022.1 beta blog post.
    Dismiss Notice
  2. Welcome to the Unity Forums! Please take the time to read our Code of Conduct here to familiarize yourself with the rules and how to post constructively.

NavMeshAgent physics

Discussion in 'Navigation' started by LeSunset, Nov 28, 2021.

  1. LeSunset

    LeSunset

    Joined:
    Apr 4, 2021
    Posts:
    1
    Hey community,

    I'm looking for a way to use NavMeshAgent with physics. So my AI gets a way more natural behaivour. I want to add thinks like random jumping to my AI and it should fall with normal gravity from objects.

    But I can't find any good ways to implement gravity to NavMeshAgent.

    Is there a way to get this done?
     
  2. N7D

    N7D

    Joined:
    Feb 25, 2017
    Posts:
    9
    You could try using navmesh only to calculate paths, while having actual agent moving disabled. Then you can use this path to follow it manually by your own code. But making sure that you somehow stay within navmesh is on you too.

    You could also use some 3rd party pathfinding tools for that, they may be better suited for this.

    P.S. You could always use navmesh agent normally and disable it temporarily, for example when you want it to jump and reenable it later.
     
  3. toonlets

    toonlets

    Joined:
    Apr 3, 2021
    Posts:
    6
    Just a quick thought, but could you have a parent be the agent and then add random animation, etc., on the child?

     
unityunity