HitReaction Setup

What is the most basic way to setup a hit reaction for an actor mesh?

Examples 1.2 is complicated and can be isolated to a few functions/etc. but what is the most basic way others have found?

I just want a projectile to be able to impact the mesh to introduce a hit reaction.

i dont think it cant get any more simple than this. give it a try. for this, you need to add a BP to the Cube, and then start adding the logic.

also, if you check Simulate physics, it will add impulse by itself, for this example i unchecked it for fun.

OnHit → Add Impulse to the Component you Hit, the Impulse Vector is the HitNormal Inverted (multiply by -1) and multiplied by the strength you want. Thats about as “simple” as it gets.

:frowning: dont Hurt the Cube you Monster joking

saw the chance and took it…it was way too good to let it pass

“also, if you check Simulate physics, it will add impulse by itself, for this example i unchecked it for fun.”
also yeah, telling you were refering to animations would have been good. line trace gives you the bone you hit. good luck on your search.
also, i think Nachtmahr answererd your question.

I am asking how to add impulse to the static mesh like when opening the physics asset you can poke the individual bones.

I am not trying to display text and add impulse at location is not affecting the static mesh at all with these setups.

I have been referencing this Docs: Physics Driven Animation in Unreal Engine | Unreal Engine 5.2 Documentation

But the setup is not complete and does not affect any mesh the projectile passes over.

How does this impact the physics asset of the cube? The cube is not being affected by the projectile like a real person would be by a bullet, i.e. a hit reaction.

Add impulse at location will force the whole mesh backwards but how to actually poke the physics asset of the mesh?

Using LineTrace I can print the bone that gets hit, however the impulse is not affecting the bone like HitReaction in Examples Map 1.2

Is there any other advice you migth have?

Well turn on Simulation and Simulation Generates Hit Event. Rest stays the same from my Solution the only difference is you also Provide the Bone you Hit to the Impulse. Here as Example I add a Impulse the applies a upward Force to the Bone that has been hit. Screenshot - 3fb12012fdccf9aa879eb47ba7863c2f - Gyazo

Alternativly you can start with the Simulation off and enable it on Hit and than apply the Force making your Target basicly a Ragdoll on Hit. Or like in the Docs mentioned only enable Simulation on the Bone you hit and all its Children like from Shoulder down to the Fingers.

I cannot turn on simulate physics because the mesh will spazz out, unfortunately. How do I enable simulation of bone on hit? I do not want the whole mesh to ragdoll, or ragdoll at all, just impulse at the bone with its physics remaining the same.

Like this.

Use whichever of the two you prefer. Dont forget to reset Simulation after a while or set Physics Blend Weight back to 0 so the animation takes over again.

Edit: forgot to plugin a Bonepin but you get the Idea :stuck_out_tongue_winking_eye:

Well make sure your Collision Setup is correct. Are they both set to Block? Are you sure you reach the Add Impulse node and the Bone is not empty? (Print String the Bone Name at the end) also the Blend weight is a value between 0-1.

All I can Tell you is that its working fine at my Side like expected. Looks like its just your Projectile that makes trouble not hitting anything.

Best way to set Physics Blend Weight back to 0?

Would it be a Timeline? How should I set up the points?

Thats totaly up to you actually. Timeline, Timer, or delay (Lerp is Optional but something to consider). I personally prefer using a Timer.

They are pretty easy to use actually. For simple guides to individual Nodes you can always look at Matthews small Tutorials. WTF Is? Set Timer in Unreal Engine 4 ( UE4 ) - YouTube

How do you set up the timer, something that I can replicate?

I have never used a timer before!