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.
-
I launch the scene and change the red box rigid body option from static to dynamic, the box falls and goes through the ground.
-
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
Thanks
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
Ex:
[SOLVED] Collision Rigidbody not working
What’s the reason for having all the objects as children of the Camera entity?
Yaustar,
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: https://playcanvas.com/editor/scene/735885
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.