x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

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: alt text

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?

Product Version: UE 4.7
Tags:
knockback.jpg (106.9 kB)
more ▼

asked May 29 '15 at 08:20 AM in Blueprint Scripting

avatar image

Blue669
251 29 39 54

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

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.

more ▼

answered Jun 25 '15 at 03:37 PM

avatar image

56DaysOfHome
21 2 1 3

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question