Cannon.js - How to prevent a PhysicsImpostor from moving due to collision

How do I prevent a PhysicsImpostor from moving even if another PhysicsImpostor collides with it. Setting the mass to 9999999 isn’t a good way.

I tried PhysicsImpostor.sleep() and it partially works by simply just stopping it from falling down from gravity, however if my player character collides with the entity it will move.

I want to turn off the meshes response to other things colliding with it. However I still want it to have collision. It would be essentially a map prop that only serves as a static mesh.
Think of counter strike, how the boxes in de_dust2 you can collide with, but it doesn’t move ever.

2 Likes

Set mass of immovable impostor to 0

3 Likes

@JohnK Thank you so much.