# Something pushes the physical body

**URL:** <https://forum.babylonjs.com/t/something-pushes-the-physical-body/10624>\
**Category:** Questions\
**Created:** [May 7, 2020, 7:22am UTC](https://forum.babylonjs.com/t/something-pushes-the-physical-body/10624 "2020-05-07T07:22:13Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![11116](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/11116/32/1410_2.png) [@11116](https://forum.babylonjs.com/u/11116)\
**Post date:** [May 7, 2020, 7:22am UTC](https://forum.babylonjs.com/t/something-pushes-the-physical-body/10624/1 "2020-05-07T07:22:13Z")

</div>

PG: [https://playground.babylonjs.com/#5W5B6W#74](https://playground.babylonjs.com/#5W5B6W#74)

Why does the rotor behave incorrectly? I think it is pushed by 2 walls, which are found in front of him and behind him. But why do they do it if the rotor does not concern them?

---

<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 7, 2020, 8:57am UTC](https://forum.babylonjs.com/t/something-pushes-the-physical-body/10624/2 "2020-05-07T08:57:51Z")

</div>

Yes, it looks like the rotor bounces between the 2 boxes. Once 1 of the box is pushed a little, it doesn’t bounce anymore.

---

<div class="post-metadata">

**Author:** ![11116](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/11116/32/1410_2.png) [@11116](https://forum.babylonjs.com/u/11116)\
**Post date:** [May 7, 2020, 9:10am UTC](https://forum.babylonjs.com/t/something-pushes-the-physical-body/10624/3 "2020-05-07T09:10:35Z")

</div>

But why is this happening? Now in my code the box is visually at least doesn’t contact with the rotor

 ![Снимок экрана от 2020-05-07 12-07-24](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/2X/e/e9886cb58026e01f56c7476c3d4d8be8feb65056.png)

f I move the box along z, there will be some gap between the box and the rotor and the balls will be able to pop out

---

<div class="post-metadata">

**Author:** ![11116](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/11116/32/1410_2.png) [@11116](https://forum.babylonjs.com/u/11116)\
**Post date:** [May 7, 2020, 10:53am UTC](https://forum.babylonjs.com/t/something-pushes-the-physical-body/10624/4 "2020-05-07T10:53:04Z")

</div>

Can I make the rotor only interact with spheres and ignore boxes?

---

<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 7, 2020, 12:51pm UTC](https://forum.babylonjs.com/t/something-pushes-the-physical-body/10624/5 "2020-05-07T12:51:56Z")

</div>

What do you need the boxes for?

---

<div class="post-metadata">

**Author:** ![11116](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/11116/32/1410_2.png) [@11116](https://forum.babylonjs.com/u/11116)\
**Post date:** [May 7, 2020, 12:53pm UTC](https://forum.babylonjs.com/t/something-pushes-the-physical-body/10624/6 "2020-05-07T12:53:37Z")

</div>

this is a lottery drum, there will be balls inside which the rotor will twist. To prevent the balls from falling out

---

<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 7, 2020, 1:09pm UTC](https://forum.babylonjs.com/t/something-pushes-the-physical-body/10624/7 "2020-05-07T13:09:18Z")

</div>

You can try to use group/mask with ammojs.  
in [Use a Physics Engine - Babylon.js Documentation](https://doc.babylonjs.com/how_to/using_the_physics_engine) search for ‘group’  
So you can disable collisions between the rotor and the boxes.

---

<div class="post-metadata">

**Author:** ![11116](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/11116/32/1410_2.png) [@11116](https://forum.babylonjs.com/u/11116)\
**Post date:** [May 7, 2020, 1:11pm UTC](https://forum.babylonjs.com/t/something-pushes-the-physical-body/10624/8 "2020-05-07T13:11:54Z")

</div>

> [@AMMO.JS Collision Response And Filtering](https://forum.babylonjs.com/t/ammo-js-collision-response-and-filtering/1493/3):
>
> Hi guys. If I may slide-in an AmmoJS testing playground… [https://playground.babylonjs.com/#XHU1HH#1](https://playground.babylonjs.com/#XHU1HH#1) (thanks to @JohnK/others… for initial playground) See console. Line 124 reports undefined. (yawn) Line 125 reports an object… difficult to “browse” for me, so far. I don’t do object-inspecting very well… for these a.prototype.b.c.lotsOfMembers objects. Just possibly… a unique collision-config needs setting, and then the collision masks/groups… will work. Anyway, we have a testing playgro…

I read that ammo don’t provide such an opportunity

---

<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 7, 2020, 3:07pm UTC](https://forum.babylonjs.com/t/something-pushes-the-physical-body/10624/9 "2020-05-07T15:07:23Z")

</div>

It’s possible.  
[https://playground.babylonjs.com/#5W5B6W#76](https://playground.babylonjs.com/#5W5B6W#76)  
I just set the group and mask values to disable collisions and show you the feature. With appropriate values, you should be able to fine tweak the collisions.

---

<div class="post-metadata">

**Author:** ![11116](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/11116/32/1410_2.png) [@11116](https://forum.babylonjs.com/u/11116)\
**Post date:** [May 7, 2020, 3:18pm UTC](https://forum.babylonjs.com/t/something-pushes-the-physical-body/10624/10 "2020-05-07T15:18:14Z")

</div>

Oh, super, thanks!

---

<div class="post-metadata">

**Author:** ![11116](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/11116/32/1410_2.png) [@11116](https://forum.babylonjs.com/u/11116)\
**Post date:** [May 8, 2020, 4:34pm UTC](https://forum.babylonjs.com/t/something-pushes-the-physical-body/10624/11 "2020-05-08T16:34:33Z")

</div>

I couldn’t understand why the masks and groups did not work for me on a local project. I decided that this is because of the version of Babylon that I put through npm packages. Because if you download Babylon from the site, then everything works. Don’t tell me what’s the matter?

---

<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 9, 2020, 7:16am UTC](https://forum.babylonjs.com/t/something-pushes-the-physical-body/10624/12 "2020-05-09T07:16:24Z")

</div>

Did you try with babylonjs nightly build?

---

<div class="post-metadata">

**Author:** ![11116](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/11116/32/1410_2.png) [@11116](https://forum.babylonjs.com/u/11116)\
**Post date:** [May 9, 2020, 8:02am UTC](https://forum.babylonjs.com/t/something-pushes-the-physical-body/10624/13 "2020-05-09T08:02:55Z")

</div>

nightly build. What is this? 🙂

I’m building using webpack. I have analyzed and I can say with confidence that only version 4.2.0 supports masks and groups.

And one more question, tell me please. I can adjust the groups and masks so that the wall and the rotor do not collide with each other, but at the same time so that they both collide with the balls

---

<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 11, 2020, 12:03pm UTC](https://forum.babylonjs.com/t/something-pushes-the-physical-body/10624/15 "2020-05-11T12:03:17Z")

</div>

for example, set the mask to rotor, box, ball to 1, 2,4 mask to 4, 4, 7 respectively  
so, rotor collides with ball only  
box with balls only  
ball with rotor, box and balls
