Hi, i’m currently working on a pixel 2D fighting game and i found a headache issue which is collision in jumping.
These are the situations which need to be solved(Suppose each character has a collider/colliders and rigibody attached):
- Jump to grounded opponent but the opponent is on your landing position. Then you stand on opponent’s head or possibly push the opponent a bit distance then slowly fall on ground. (The player is supposed to fall on the ground smoothly)
- Jump will be blocked once the opponent is jumping on your head.(The player is supposed to make a complete jump)
- Your opponent is stand at the left/right edge of the screen, you jump toward to him and stoppped on its head.(The player is suppose to land on the right of the opponent if opponent is at the left edge or to land on the left side of the opponent if opponent is at the right edge)
- Silimar to 3. Your opponent is jumping at the edge of the screen, and the player is also jumping toward it there.(This is the most headache part.)
I did some tries to shift the horizontal position of the player/opponent in the above situations when collision happens, but it somehow looks not that smooth and it can’t cover all situations.(Considering the opponent can move at same time, the situation becomes more complex when only implemented simple shifting)
Hope i explained the issue clearly.
So, is there any suggestion or existing good solutions for such issue?