So I'm trying to make a system in which when a player or enemy with platform behavior gets hit with a certain attack, they are knocked back and briefly stunned. This kind of mechanic is common in a lot of games, such as fighting games. I have the basics in place - stunning the player and disabling their controls, but getting the actual knockback to work continues to give me trouble.
Knockup in a vertical direction is fairly easy, you just set the Vector Y on the platform behavior and it behaves appropriately. Moving the player in the horizontal direction is more difficult, because the Vector X is affected by the platform behavior's natural deceleration, which is pretty high in my game. I don't want to lower the ground deceleration too much or I'll lose the precise feeling of the controls, but as it is even if I set the vector X to the max speed the platform behavior allows it still barely moves the character backwards at all.
Is there an alternate method to handle knockback better, one that would give me more control? I'd like to be able to do large knockbacks (ie: hit a character across a screen's length), ideally with some control over things like deceleration. It's also important that the knockback continue to interact correctly with solids, such that the character can't be thrown through walls and won't end up with their platform behavior bugged out.
Any thoughts? Have others had to approach this problem? What kind of solutions did you use?