I can only describe this problem like this picture
Hero and Enemy both have platform behavior.
gray boxes are solid floor objects
blue arrow - velocity of enemy being pushed towards solid
green arrow means the hero punches the enemy
The others are already listed in the picture
Bro, I remember you. You helped me before. Can you help me also here?
this is the picture explanation
condition for this is of course when player character is overlapping solid object