Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.

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.