Hit Reaction

Hello.

I am a beginner working on UE 4.8.1. I am working on a scene where a Cop is walking patrol. When the player enters a triggerbox - the cop walks towards him (simple move to) and returns to his routine on end overlap trigger. I have managed to make the player execute punching animations on keypress. Now I am trying to figure out how to make the
cop show an animated reaction to being hit. I have made an attempt to bind the cop-Animation to the button pressed - but that does not include the distance between the two players. Is there a simple way to trigger the animation ONLY if the Cop has reached the players location ? Please help :frowning:

One quick way I can think of is to attach a collision sphere to your characters fists. On button press event, enable the collision (on release, disable collision. At this point you could also make an AnimNotify to enable/disable the collision at the exact time that your character could be colliding) then on event overlap for the sphere,(you might want to put a do once retriggable here to stop collision returns every frame that fists collide with your enemy - if you dont hit your enemy at first but may hit them in this animation then you can re trigger the do once until you return an enemy hit) test if its your enemy, then cast to that enemy and call a function which would play the hit reaction anim and deal damage etc. Hope this helps :slight_smile:

Could you please upload a screenshot of the blueprint you describe ? I´m in the very early stage of Game Development and visual information would be very helpful.

I have figured out the sphere collision part including the on-press-key-enable-disable-part so far.