I need to develop a game , in which atleast 100 small objects will be placed, I need their physics behavior when some object (Ball or Drum) fall on to them or pass through them.
Problem is that for collision every object need Collision and Rigidbody. It takes lots of fps.
Any way to improve fps in this situation.
I am attaching some images
At the moment, Ammo.js is running on the main thread which doesn’t help. Options basically boil down to use less objects or a different physics library:
- Use less physics objects
- Modify the engine to run Ammo on worker thread (which not all your players will support this)
- Write your own physics library to handle simple collisions only
- Use another physics library that may be more performent
- If the game is really a 2D physics game with 3D graphics, you can use p2.js which should be faster https://playcanvas.com/project/446127/overview/p2js-integration