Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice
  2. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  3. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Suggestion: NavMesh updates in FixedUpdate?

Discussion in 'AI & Navigation Previews' started by Multithreaded_Games, Feb 15, 2017.

  1. Multithreaded_Games

    Multithreaded_Games

    Joined:
    Jul 6, 2015
    Posts:
    122
    Hi,

    I was wondering if it would be possible to add an option (even in the Navigation pane) to switch all Navmesh processing/updating to occur in FixedUpdate?

    My issue is that I am using a NavAgent to keep my character on the ground and away from certain areas (but without using the actual 'path-finding'), while also using physics/FixedUpdate to drive the character. This is a legacy implementation that has slowly bubbled its way up to our current project state and as such, is incredibly difficult to just 'break away' from.

    Movement works flawlessly except for the case where the character is 'bounced' back from NavMesh collisions (rather, the attempt to keep the character on the NavMesh) If I transfer the movement code to Update, the NavMesh collisions are largely on point, but the other physics collisions suffer.

    My question then, is how difficult would it be to implement a mode where NavMesh updates are handled in FixedUpdate and not regular Update? I can't imagine this would be difficult, but I could see it being very beneficial, even in cases where developers want to use the actual pathfinding with physics/Rigidbodies and have it synced up to FixedUpdate.

    Thanks!
     
    SM_AF and laurentlavigne like this.