Kocking Back Actor + Ragdoll Impulse
I'm currently trying to implement a knock-back effect whenever the player hits an enemy with an attack. So if I shoot a weapon or a projectile hits the enemy, a vector variable is set called "Hit Location", where the collision happened. When the enemy still has health left, I just want to push or "knock-back" the enemy based on the location where it was hit. I've searched through the Answers Hub and here, but the best I could come up with was this attempt:
But this does not seem to actually shove the enemy back, but it shoves it in weird directions and sometimes with more force and sometimes with less...?!? I really suck at vectors...
Also if the enemy is dead I turn it into a ragdoll. This works fine by turning "Set Simulate Physics" on. Now the Hit Location should be used to "Apply Force at Location" to the ragdoll, so it flies away from where the bullet hit the enemy. But I don't really understand why I need two vectors, one for location and one for the force. I've tried to look up a way to calculate this, but I couldn't find anything that explains how to set this up correctly.
Could someone please tell me how to do the two desired effects?
asked May 29 '15 at 08:20 AM in Blueprint Scripting
Hi, I'm not that experienced with UE4 but I probably know how to do this. Ok, so you need to get the direction of the enemy when the enemy first shot the projectile. If you created a physics asset for your character in UE4 then get which one of the phyisics bodies the projecile hit, and apply the impulse in the direction of the enemy when it first shot the projectile. It may be wrong but I'm not that experienced.
answered Jun 25 '15 at 03:37 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here