When using physics meshes, those meshes will move unless you tell them not to. So you just need to find the meshes being used and see if you’ve forgotten something.
In this case, look inside the addBoard()
function. The first beam that is built looks like:
var beam1 = new Physijs.BoxMesh(shape, cover);
That’s a physics mesh that will move. To keep it from moving, add a third parameter, zero, after shape
and cover
:
var beam1 = new Physijs.BoxMesh(shape, cover, 0);
All of the other beams in the board have that last zero parameter, so your code will work after making this one change.
-Chris
Thanks now its working perfectly!
I mean my Ball fall through the Middle!