Apply force to NPC (Jedi force push)


In a simple FPS project I did some blueprint scripting and insted of shooting with projectiles I can push objects (ray cast and add force).

Now, I’d like to do the same with an enemy that uses some AI (like Simple move to actor). So, the effect is similar to jedi force push - the enemy is coming and the player can push him in the opposite direction.

In the player’s blueprint there are all the mechanics with the ray casting, but I don’t know how to connect it with pawns. There’s a nod for “hit component” to apply force, but I can’t figure out how to get the pawn hit.

You can use the add force or radial force, but you will need to convert your enemy over to a ragdoll state to be affected by it.

Have a look at Rama’s plugin as he has a very simple way to toggle this on and off which is what you want to be able to do.

Ok thanks, I’ll take a look at that. I also tried casting hit actor to character and it worked, but has some issues due to the nav mesh.

Any tips about AI? I’m trying to do flying enemies (I know that there’s no pathfinding in flying AI in ue4), so I hesitate whether to choose a pawn and nav mesh + simple move to OR write the movement myself without any build-in AI and nav meshes. I’m not sure which approach would be better to combine with applying force and flyers.

If they aren’t on the ground then pretty much you have to write your own methods of moving around at the moment. You can still use all the regular behaviour tree setup, just use your own move to function.

Got it, thank you.