[Question] Get Hit Force

Hi,

I was wondering if someone could explain to me how to get the force of the object (How hard it hit you) when you do a “On Hit” event.

For example, I fall on the ground, i hit the ground, I want to know how hard i hit the ground… :3

What i’m trying to get this to work for, is things like rocks falling on your head. So that if a physics object falls on you, it negates a specific amount of health based on the force it hit you with.

Edit:
Also, i’d like to be able to do this all on the players blueprint, so that i don’t have to edit all of my physics objects.

Thanks!

#Getting Force of Impact, Mass x Speed

  • Speed = Velocity → Vector Length
  • Mass = yay, easy function for this

You can use my node setup below to get the speed x mass of the other object at the moment of impact.

You could add this to the speed x mass of Self at the time of impact to get total force of impact involved

As it is though, this node setup will tell you the force of Other upon Self, like rock falling onto player

I am printing the results to the screen for easy of testing and determining how much damage you want to apply :slight_smile:

#:heart:

Rama

3 Likes

Thank you so much! The “Vector Length” function was what I’ve been looking for for a while

I updated my pic, see the new pic it’s even better :slight_smile:

actual FORCE by getting the MASS as well :slight_smile:

Is there a way to check the velocity only when the object falls on you?.. Cause as is, it can be sitting on the ground and it has a higher velocity when I walk into it then it did when it was falling on my head…

#Velocity.Z < 0

You will have to check whether .Z of the velocity is a negative number or not to know if the rock is falling

:slight_smile:

Rama

#Physics Linear Velocity


Also if you are using a static mesh that is simulating physics, rather than a skeletal mesh or character,

you should definitely be using Physics Linear Velocity with Other Comp

2 Likes

The only issue i’m seeming to have now, is that when it initially falls, it falls right through the character. I’ve set the collision preset to “BlockAll”, and after it initially falls, i can walk into it and tell that the collision is working. but when it initially falls, it goes right through me… Any idea why?

Nevermind, Turned out i didn’t have the right collision preset on my character.

#Yay!

Congrats on getting it working!

I’m new to blueprints, but what is that node that’s just a dot called? It’s coming off of the multiply in your event graph.
EDIT: nevermind, i figured it out: it’s a “to string” node. nothing like common sense, eh? figure i’ll leave this comment just in case any other newbies find it helpful.

How would I times this by the impact angle, ie how direct the impact is? so if you had a head on collision it would do more damage than just hitting another object at a shalow angle even if you were going faster

This is a part of making my portals. Thanks so much!