I just started a small game in order to experiment with BGE,
Basically it is a snowboard moving on a slope but I can’t get collision detection to work properly.
The board is set to Convex Hull (which gives less problem) and ground is set to Triangle Mesh.
At some point the board slip into the ground and fall. I’ve made a quick video which shows the problem:
I don’t know what settings could be changed?
I’ve managed to prevent the board from falling by increasing the margin parameter but then the board is far above the ground and it doesn’t look realistic.
I would appreciate if someone know the problem and could help me.
First, thanks all for your ideas,
As I’m really beginning, I don’t see exactly how to figure out yet.
Basically, I can see the point of using boxes to get a simple physical shape of a complex mesh, it is more efficient (and less accurate) than using directly triangles.
But in my case with a very simple mesh ( a plane), I thought it would collide properly ?
Taking first advice,
Create a separate box object that has your physics properties (with the increased margin to prevent moving through the ground). Then place your snowboard inside this box and set it to ‘no collision.’
If I understand correctly, we use parenting with another box, and applying the margins to the parent instead of the object, will help overcome accuracy issue?
The thing I don’t see clearly at the moment; is what is changing from the case where you put directly the margins to the object?
Still there are the margins of the parent box applying to the object inside of it and preventing it from being sticked to the ground?
I don’t know if I explained myself correctly, sorry if if this seems obvious for you, I’m trying to get the idea.
Also I’ll look more deeply at the blend (thanks for it) to see the way it is done. If you have any doc, or tuts which could help, I’d also be glad :eyebrowlift:
well, after some experiment I could see what was wrong, the shape indeed matters a lot in terms of proportion:
-I started with a cube including my object and it collides correctly
-then I decreased the size to make it fit the width of the object, still colliding properly.
-the problem occurs when I squash the height to make it nearly a plane.