Rigidbody Physics with just the PlayCanvas Game Engine

Hi, I’m making a game using just the Playcanvas game engine and codepen.io and I don’t know how to add rigidbody physics into my game. I tried adding both collision and rigidbody components but that did not work.

Make sure you load Ammo physics library, before you add physics components. Here is an engine-only example, that uses physics:

I loaded the Library and now all of my objects are gone? I don’t know what happened but it only disappears when I add the rigid body component. They didn’t fall into the void because I tried teleporting them back to 0,0,0 and they didn’t.

Make them kinematic, so they don’t fall. If they disappear right from the get go, then you are setting invalid position on them. You need to debug your code, it is hard to say what is happening there. You can use @yaustar booklet, it has a visual debugger of Ammo, so you can actually see the physics state:

I changed it to kinematic and nothing changed but then when I set it to static it worked for one of the objects but not the other