Sample of Physics

Hello, how to use physics of babylon.js to do the following simple example. We have a simple scene, the object “plane” set as ground. Another object - box stands still on the object “plane” - without movements, weighs 1kg. A second box weighs 5kg and moves at 20km / h. Two mentioned boxes collide. Is it possible to simulate this? Somehow? I searched the documentation, but did not understand if it is possible and how to create this?

The second question about what is the best way to make a box that moves is invisible to the camera, yet is involved in a collision?

Summoning @Cedric

Hi @Johny_Mickey

Something like this ?
https://playground.babylonjs.com/#RFXCS6
I set the velocity to a lower value to see the effect more clearly.
An invisible box will push the box on the left after a couple seconds. Uncomment line 32 to see the mesh.

1 Like

Thank you very much for your sample! Only one thing is unclear to me, How to implement a real box speed in the system, for example 20km / h.

it depends on your unit. If you are consistent and for you, 1 unit = 1 meter. then set the velocity to 20000m/h == 5.5m/s
setvelocity accepts world units per seconds

1 Like

hello, you can take a look at my playground, it seems close to what you want to do (except units) : https://playground.babylonjs.com/#RGNDK2

1 Like