Hey ! Tryng to make a two player fighting game. 2D figthing.
I have a system when my players when they press a key, an hitbox is display on there arms.
When my hitbox is create, when it enters in collision with one of the two players. They get pushed.
My push system is working with setting max speed and Vector x.
But, i want to do a push also when one of the two players is on the wall. Then, my player who hit the other one, is pushed out.
On neutral, if P1 getting hit, P1 is pushed. If P1 is next to a wall, my P2 is pushed out.
Right now, when my P2 is close to a wall, but not in collisions with it and if he gets hit. He will receive the push from the attack, but, because he gonna hit the wall while moving, my P1 character who hits, will be pushed also.
I want that, but i want my P1 get pushed back at the same distance like if my P2 was in collisions with the wall.