How could I add physics upon hit when my character gets hit?

I am curious how would one (in blueprints) do the following:

  • When hit by object (discover which angle the hit happened)
  • Add Force/Launch in opposite direction

I am trying to make a hit reaction to being hit by big boulder in my game. Does one do this with animations or more simply thru blueprints.

Any insight would be appreciated (or event better a blueprint example), thank you… and a +1 coming for ya.

Very simply: create an event hit which would containt the necessary info regarding the colllision. You can use the “hit normal” to detemine the direction of the hit. Then simply normalize and inverse this vector to find its opposite. Finsih by connecting it to an “add force” function. I haven’t put it here, but you may want to get the speed, mass etc. of the “other” actor/object and use it as a multiplier for the force after reversing the normal vector. Alternatively, you can multiply it with some constant.

Thank you kind sir!!!

Much appreciated.

What kind of Collision Presets should my character be to find this “Add Force”?

Currently, it is unelectable when trying to select this node. I was trying to use it on my character, which is setup as a Pawn.

I tried using Physics Actor, but didn’t help. Any suggestions… am I missing something to be able to pull this add force on my character

Try checking the rolling ball template that comes with UE4 by creating a new project. Also, the Content Example game in Marketplace has a physics-driven UFO blueprint in “Blueprint Input Examples” level. IThe UFO bounces off the walls and creates a spark effect at the hit point. That should help you figure out how to do it.

Hi DreamBotStudios,

We have not heard back from you in a few days, so we are marking this post as Resolved for tracking purposes. If you are still experiencing the issue you reported, please respond to this message with additional information and we will offer further assistance.

Thank you.