hi guys,
for some practice i am working on some kind of a “2d” sidescroller (its actual 3d, but with z-axis fixed at 0)
i just wanted to start with some plattforms to walk on.
i create these platforms:
[java]
private void initGround(int transX, int transY, ColorRGBA color) {
Box boden1 = new Box(20, 0.2f, 3);
Geometry bodengeom = new Geometry("Box", boden1);
Material bodenmat = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
bodenmat.setColor("Color", color);
bodengeom.setMaterial(bodenmat);
bottomNode.attachChild(bodengeom);
bodengeom.setLocalTranslation(transX + offset - 5, transY, 0);
bodengeom.addControl(new RigidBodyControl(0));
bulletAppState.getPhysicsSpace().addAll(bodengeom);
}
[/java]
and want my character to walk on.
it works on one part of the platforms, but approximately on the half the chracter just falls through it.
i activated bulletAppState.setDebugEnabled(true); and saw that there is an diagonal edge cutting through the boxes shape, right whre the character falls. This lets me think that the collision shape of the rigidbody is not the same as the boxes geometry.
what can i do to fix this problem?
thx,
Birchwood