Search Issue Tracker

By Design

Votes

2

Found in

2017.4

2018.4

2018.4.13f1

2019.2

2019.3

2020.1

Issue ID

1204225

Regression

No

NavAgent gets stuck inside GameObject with NavMeshObstacle Component when obstacle's size is increased

AI Navigation

-

How to reproduce:
1. Open the attached project's Scene labeled "NavMeshJumpBugExample"
2. Enable "MaxJump19-NavObstacle" GameObject in Hierarchy
3. Enter the Play Mode
4. Observe NavAgent's behavior
5. Exit Play Mode
6. Disable the previously enabled GameObject
7. Enable "NoJump19.01-NavObstacle" GameObject in Hierarchy
8. Observe NavAgent's behavior

Expected result: NavAgent gets unstuck
Actual result: NavAgent is stuck in the NavMeshObstacle

Reproducible with: 2017.4.35f1, 2018.4.13f1, 2019.2.15f1, 2019.3.0f1, 2020.1.0a15

----------------------
Information from developer:
It is expected that the NavMeshAgent will look for a NavMesh only within a volume of this size (20 * agent.radius, 15 * agent.radius, 20 * agent.radius) centred at the Agent (where radius is the value defined for obstacle avoidance purposes). In this reported issue the obstacle is 19.1 units wide and there will be one extra unit (= 2 * 0.5) being carved around the obstacle. Because the NavMesh is more than 10 units away the Agent will not be able to find it automatically.
Please use `NavMesh.SamplePosition()` to find a new position on the NavMesh where the agent should be moved.
Another solution would be to move the agent closer to the borders of the Obstacle.

  1. Resolution Note (2017.4.0):

    Information from developer:
    It is expected that the NavMeshAgent will look for a NavMesh only within a volume of this size (20 * agent.radius, 15 * agent.radius, 20 * agent.radius) centred at the Agent (where radius is the value defined for obstacle avoidance purposes). In this reported issue the obstacle is 19.1 units wide and there will be one extra unit (= 2 * 0.5) being carved around the obstacle. Because the NavMesh is more than 10 units away the Agent will not be able to find it automatically.
    Please use `NavMesh.SamplePosition()` to find a new position on the NavMesh where the agent should be moved.
    Another solution would be to move the agent closer to the borders of the Obstacle.

Comments (1)

  1. aFeesh

    Dec 11, 2019 18:58

    This issue is related to this Forum topic: https://forum.unity.com/threads/changing-max-jump-distance-in-unity-nav-mesh.788474/ there's a workaround, but it's not as intuitive as the expected result.

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.