Search Unity

  1. Unity 2019.2 is now released.
    Dismiss Notice

AIThirdPersonController rotates at target object

Discussion in 'Navigation' started by bboydaisuke, May 9, 2015.

  1. bboydaisuke

    bboydaisuke

    Joined:
    Jun 14, 2014
    Posts:
    58
    Hi there,

    I guess everyone uses Auto Breaking option for Navmesh because it keeps rotating after the character reaches the target.
    AutoBreaking doesn't work as I expected for me. It stops once but after one or two seconds, it start walking again and rotates on the goal.

    What I did is this:
    1. Open new scene
    2. put plane at (0, 0, 0)
    3. put AIThirdPersonController at (0, 0, 0)
    4. put empty GameObject at (4, 1.5, 0)
    5. Assign empty GameObject to Target for AICharacterContol of AIThirdPersonController
    6. Configure NavMeshAgent as follow:
    Radius 0.5
    Speed 0.7
    Stopping Distance: 1.5
    Auto Breaking: checked
    7. Open navigation window and bake plane object as "Navigation Static" checked
    8. Run

    Then the character walks towards object and stops. And few seconds later, charater starts shaking and walks again then starts spinning at the goal.
    Though I thought I had to disable the object when the character stops, Unity's sample project doesn't look like doing like that.
    How can I stop the character and stop the rotation?

    thanks,
    bboydaisuke
     
    Last edited: May 9, 2015
  2. bboydaisuke

    bboydaisuke

    Joined:
    Jun 14, 2014
    Posts:
    58
    Further investigation:
    I disabled Auto Breaking in Sample project but character still stops before it reaches the target. Seems like it forces stop the character in the project (not disabling NavMeshAgent). So there must be some tricks in the sample project in order to stop the character.
     
  3. bboydaisuke

    bboydaisuke

    Joined:
    Jun 14, 2014
    Posts:
    58
    Changed the thread title.
     
  4. bboydaisuke

    bboydaisuke

    Joined:
    Jun 14, 2014
    Posts:
    58
    Partially solved.
    I imported "GroundExtents" from sample project, added it to the plane, bake plane, and run. Then character stops as sample project.
    Still not sure why "GroundExtents" stops the character.