I want to make a jump like in the Mario game. When you are under the platform and you jump, you can then pass through the collider.
When a player's velocity is going down, colliders should wake up. I know that I should use ContactListener, but when I'm using the contact.setEnable(false) method nothing happens.
My contact listener (ground checker works perfectly)
world.setContactListener(new ContactListener() {
@Override
public void beginContact(Contact contact) {
if(contact.getFixtureA().getBody().getUserData() == "ground" && contact.getFixtureB().getUserData() == "groundChecker"){
character.isGrounded = true;
System.out.println(" Colliding");
}
}
@Override
public void endContact(Contact contact) {
}
@Override
public void preSolve(Contact contact, Manifold oldManifold) {
}
@Override
public void postSolve(Contact contact, ContactImpulse impulse) {
}
});
What and where should I put to get effect like this.
Collider should have only one side, have somebody deal with it?
