Collision Rigid Body not working

I have two issues
I am learning how to use some features so I created a simple scene with four primitives a white box that moves left to right as soon as scene is launch and a blue cylinder that moves when you use the key board arrows, both works fine

However, the red box and the green ground (box) both have collision and rigid bodies. The ground rigid body option is set to static and the red box is also currently set to static.

  1. I launch the scene and change the red box rigid body option from static to dynamic, the box falls and goes through the ground.

  2. The reason the red box is static before I launch is because if I change the option to dynamic and launch the scene the red box can’t be seen.

Here is a link to the simple scene: PlayCanvas | HTML5 Game Engine

Not sure why collision / rigid body features in editor not working. Can you help me understand why

Have you tryed modifying the dynamic body?
When you look at this you have no modifications to the body… But thisis not the only problem as i look at it… are you trying to make the box move back and forth?
@Angel727 fixed the problem all those scripts that you have on the camera…
I removed them and it works just fine :slight_smile:

OK Thanks, I guess I forgot to remove the scripts from the camera when I made the simple scene.

1 Like

Yes can you make the topic solved
[SOLVED] Collision Rigidbody not working

What’s the reason for having all the objects as children of the Camera entity?

On my original scene I was testing entities where I made them dissolve out when I selected a different object, change objects to other objects and rotate an object when I selected different objects. But when I added the red box and the ground and wanted to have the box fall and react to the ground it did not work. So I made the simple scene to see if it would work.

The objects shouldn’t be children of the camera as when the camera moves (which the scripts do do), it will move it’s children which you don’t want and my lead to unexpected behaviour when physics are involved.

Something like this:

What I suspected had happened in your original scene was that the orbitcamera script moved the camera and all it’s children to a new position. However as the red box is a dynamic rigid body, the physics simulation kept it at its spawn position.

Thanks Yaustar

This works great