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. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  3. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

Suggestion: NavMesh updates in FixedUpdate?

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

  1. Multithreaded_Games


    Jul 6, 2015

    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.

    SM_AF and laurentlavigne like this.