How can I have an enemy knock me back when I run into him?

Currently I’m using the roaming ralph code. I have an enemy in the world that moves up and down. I would like to set it so that when ralph collides with him, he gets knocked back.

Right now I’m using a simple collision sphere on the enemy to get the collision to work. I tried using a pusher collision on the enemy and creating a collision sphere around ralph, but then ralph won’t move any more. Does anyone have any suggestions on how to get ralph to be knocked backwards?

The pusher should work.
If Ralph doesn’t move anymore after the collision you must have done something wrong (that’s all I can assume, as I know neither Ralphs code, nor your changes).
Anyway, I don’t think you’ll want to use the pusher, because if you do use it, it will let your character be pushed back from everything it collides with, which would include collectable objects (if you’re planning on implementing them anyway).

So you might want to try the collision event handler.
Create different reactions to different objects that ralph could collide with.

The simplest way to achieve the desired behaviour here would be to just reset Ralphs position a few WUs (World Units) if he collides into his “enemy”.