# Small Agent going through big Obstacle

**URL:** <https://forum.babylonjs.com/t/small-agent-going-through-big-obstacle/38268>\
**Category:** Questions\
**Tags:** navmesh\
**Created:** [February 15, 2023, 11:13pm UTC](https://forum.babylonjs.com/t/small-agent-going-through-big-obstacle/38268 "2023-02-15T23:13:35Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![Takemura](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/takemura/32/25836_2.png) [@Takemura](https://forum.babylonjs.com/u/Takemura)\
**Post date:** [February 15, 2023, 11:13pm UTC](https://forum.babylonjs.com/t/small-agent-going-through-big-obstacle/38268/1 "2023-02-15T23:13:35Z")

</div>

Hello dear community,  
How can I configure the NavMesh / Crowd, so that my agents of size (0.5, 2, 0.5) avoid going through obstacles of size (20, 5, 20)? I only get it to work when the difference of agent and obstacle sizes are less. I tried different configurations like walkable attributes or tileSizes, but it didn’t help.

Here is my PG:

> **[Babylon.js Playground](https://playground.babylonjs.com/#404RJ7%2347)**
>
> Babylon.js playground is a live editor for Babylon.js WebGL 3D scenes

---

<div class="post-metadata">

**Author:** ![Evgeni\_Popov](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/evgeni_popov/32/4432_2.png) [@Evgeni\_Popov](https://forum.babylonjs.com/u/Evgeni_Popov)\
**Post date:** [February 16, 2023, 10:26am UTC](https://forum.babylonjs.com/t/small-agent-going-through-big-obstacle/38268/2 "2023-02-16T10:26:50Z")

</div>

cc @Cedric

---

<div class="post-metadata">

**Author:** ![Cedric](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/cedric/32/2742_2.png) [@Cedric](https://forum.babylonjs.com/u/Cedric)\
**Post date:** [February 16, 2023, 12:38pm UTC](https://forum.babylonjs.com/t/small-agent-going-through-big-obstacle/38268/3 "2023-02-16T12:38:03Z")

</div>

Hi @Takemura  
I’m trying to repro your issue with documentation PGs and I can’t get the same issue (I think).

> **[Babylon.js Playground](https://playground.babylonjs.com/#WCSDE1%23124)**
>
> Babylon.js playground is a live editor for Babylon.js WebGL 3D scenes

If I understand correctly, the agent can avoid the obstacle if the difference in size between agent and obstacle is low.

Can you tweak the PG above to repro it?

---

<div class="post-metadata">

**Author:** ![Takemura](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/takemura/32/25836_2.png) [@Takemura](https://forum.babylonjs.com/u/Takemura)\
**Post date:** [February 16, 2023, 11:34pm UTC](https://forum.babylonjs.com/t/small-agent-going-through-big-obstacle/38268/4 "2023-02-16T23:34:51Z")

</div>

Hey @Cedric, thanks for your time.

I think i was able to repro, pretty much changed size of obstacle mesh and changed to box obstacle type instead of cylinder:

> **[Babylon.js Playground](https://playground.babylonjs.com/#JJUMZZ)**
>
> Babylon.js playground is a live editor for Babylon.js WebGL 3D scenes

---

<div class="post-metadata">

**Author:** ![carolhmj](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/carolhmj/32/25918_2.png) [@carolhmj](https://forum.babylonjs.com/u/carolhmj)\
**Post date:** [March 17, 2023, 12:46pm UTC](https://forum.babylonjs.com/t/small-agent-going-through-big-obstacle/38268/5 "2023-03-17T12:46:23Z")

</div>

Hi @Takemura apologies for not following up earlier, are you still having issues?

---

<div class="post-metadata">

**Author:** ![Takemura](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/takemura/32/25836_2.png) [@Takemura](https://forum.babylonjs.com/u/Takemura)\
**Post date:** [March 17, 2023, 3:36pm UTC](https://forum.babylonjs.com/t/small-agent-going-through-big-obstacle/38268/6 "2023-03-17T15:36:38Z")

</div>

The agent still goes through the box obstacle. Is it just on my spec or do you have the same issue?

---

<div class="post-metadata">

**Author:** ![carolhmj](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/carolhmj/32/25918_2.png) [@carolhmj](https://forum.babylonjs.com/u/carolhmj)\
**Post date:** [March 17, 2023, 4:08pm UTC](https://forum.babylonjs.com/t/small-agent-going-through-big-obstacle/38268/7 "2023-03-17T16:08:56Z")

</div>

At least here the little box stays in place for a moment, then moves parallel to the big box:

 ![image](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/a/9/a9eab79a33b6dc092f5073f4d8d4ca53506a9de5.png)  
Is this the expected behavior?

---

<div class="post-metadata">

**Author:** ![Takemura](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/takemura/32/25836_2.png) [@Takemura](https://forum.babylonjs.com/u/Takemura)\
**Post date:** [March 18, 2023, 4:43pm UTC](https://forum.babylonjs.com/t/small-agent-going-through-big-obstacle/38268/8 "2023-03-18T16:43:24Z")

</div>

This image shows the unexpected behaviour, the agent (small purple box) is not allowed to go through the box collider (big grey box) it should go around or stop before collision:

 ![navmesh no collision](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/a/8/a8dc01657a523447f5b143f0c802a2ea69270041.jpeg)

---

<div class="post-metadata">

**Author:** ![carolhmj](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/carolhmj/32/25918_2.png) [@carolhmj](https://forum.babylonjs.com/u/carolhmj)\
**Post date:** [March 20, 2023, 2:03pm UTC](https://forum.babylonjs.com/t/small-agent-going-through-big-obstacle/38268/9 "2023-03-20T14:03:22Z")

</div>

Oooh I hadn’t noticed that you can click on the scene to direct the small box! I do see it going through the big box now.

---

<div class="post-metadata">

**Author:** ![Cedric](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/cedric/32/2742_2.png) [@Cedric](https://forum.babylonjs.com/u/Cedric)\
**Post date:** [March 20, 2023, 2:10pm UTC](https://forum.babylonjs.com/t/small-agent-going-through-big-obstacle/38268/10 "2023-03-20T14:10:35Z")

</div>

I’m taking a look. My first thought is the problem is related to parameters. Let’s see if I’m wrong 🙂

---

<div class="post-metadata">

**Author:** ![Cedric](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/cedric/32/2742_2.png) [@Cedric](https://forum.babylonjs.com/u/Cedric)\
**Post date:** [March 20, 2023, 4:50pm UTC](https://forum.babylonjs.com/t/small-agent-going-through-big-obstacle/38268/11 "2023-03-20T16:50:09Z")

</div>

It looks like a bug when using a boxObstacle. Cylinder seems fine. I doing more investigations…

---

<div class="post-metadata">

**Author:** ![Cedric](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/cedric/32/2742_2.png) [@Cedric](https://forum.babylonjs.com/u/Cedric)\
**Post date:** [March 20, 2023, 4:50pm UTC](https://forum.babylonjs.com/t/small-agent-going-through-big-obstacle/38268/12 "2023-03-20T16:50:16Z")

</div>



---

<div class="post-metadata">

**Author:** ![Cedric](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/cedric/32/2742_2.png) [@Cedric](https://forum.babylonjs.com/u/Cedric)\
**Post date:** [March 21, 2023, 9:03am UTC](https://forum.babylonjs.com/t/small-agent-going-through-big-obstacle/38268/13 "2023-03-21T09:03:45Z")

</div>

I tweaked the doc playground to reach almost the same size as your PG. It works.

> **[Babylon.js Playground](https://playground.babylonjs.com/#XM2GBW)**
>
> Babylon.js playground is a live editor for Babylon.js WebGL 3D scenes

I had to change the tilesize for that.

---

<div class="post-metadata">

**Author:** ![Cedric](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/cedric/32/2742_2.png) [@Cedric](https://forum.babylonjs.com/u/Cedric)\
**Post date:** [May 25, 2023, 12:52pm UTC](https://forum.babylonjs.com/t/small-agent-going-through-big-obstacle/38268/14 "2023-05-25T12:52:03Z")

</div>


