I was wondering how you make a knockback effect, when you strike an enemy. The first thought that crossed my mind was to have detectors or something at either side of an enemy, then say for example, if the player strikes the enemy with a sword, the enemy will get knocked back in the direction of the detector, that the sword collides with.
This doesn't seem like a very effective method though, as what if the sword is larger than the enemy and it hits both detectors? Is there a better way of achieving this?