[SOLVED] Dynamic Rigid Body is not falling with gravity or affected by forces


#1

The cube in my example is a Rigid Body with Dynamic enabled (not static). It also has Colider enabled. You would expect this cube to fall, with gravity. But its just staying still.

Would this be a bug from the latest PlayCanvas update? This is only happing for newly created projects since the recent update.


#2

Hi, we are in the process of updating physics and for now the option to include a physics library is not automatically enabled. Please go to Scene Settings->Physics to enable physics in your game.


#3

Thanks :slight_smile: will do that now.


#4

Hi codebon, can you share more info about this?


#5

Hi @Hugo_D,
We’re adding support for wasm modules in playcanvas and then updating to the latest version of ammo.js.
Thanks!


#6

@Hugo_D Yes. We are updating the way ammo.js is included in a PlayCanvas project in the Editor. Currently, if the ‘Enable Physics’ checkbox in Settings is checked, ammo.js is loaded internally. We’re removing the ‘Enable Physics’ checkbox and you’ll instead import ammo.js as a regular script asset. This means you can replace it which whatever version you like - for example, you could build ammo.js from source and use that (say, if you wanted to expose some new Bullet functions to your app). A further benefit is that we’ll be enabling the loading of the WebAssembly build of ammo.js with this update. This will bring a large performance boost for using physics in your apps.


#7

Amazing! Thank for your answers


#8

When will this update be released?


#9

Hi @Geniteam,

The new physics has now been released. For updating existing projects you can see https://developer.playcanvas.com/en/user-manual/physics/physics-migration/

Thanks!


#10

So, does the performance improve by using the WASM modules?


#11

Yup that’s right.


#12

Thank you, Good to see playcanvas engine improving.