Search Unity

NavMeshAgent.Warp() works incorrectly when Rigidbody.interpolate enabled. Please fix documentation!

Discussion in 'Navigation' started by AntonPetrov, Jun 12, 2020.

  1. AntonPetrov

    AntonPetrov

    Joined:
    Dec 27, 2013
    Posts:
    63
    So I did managed to reproduce a bug when
    NavMeshAgent.Warp()
    works incorrectly and this is because of enabled
    Rigidbody.interpolate
    .

    So it looks like documentation on NavMesh Agent and Physics (https://docs.unity3d.com/Manual/nav-MixingComponents.html) is incomplete. Not only IsKinematic must be turned on but Interpolation must be turned OFF to use NavMeshAgent with a Rigidbody!

    ORIGINAL POST


    I have a player character controlled by the keyboard input.
    I have
    NavMeshAgent.updatePosition
    set to True and I move character around by setting
    NavMeshAgent.velocity
    directly from the input.

    To teleport my character from one NavMesh island to another I use
    NavMeshAgent.Warp()
    but sometimes occasionaly my character ends not on the desired destination point but on the NavMesh edge of the second island like it was pulled to the first island after being warped.

    Is it a known bug or a known pitfall?
     
    Last edited: Jun 12, 2020
  2. Lukas_Schwarz

    Lukas_Schwarz

    Joined:
    Aug 3, 2013
    Posts:
    7
    Same happens in 2019.4.5f1.

    Unity should either fix it or put it in the docs!

    Edit: I reported it on the doc page that you linked above
     
    Last edited: Oct 2, 2020