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"

[Closed] [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!

Product Version: Not Selected
Tags:
more ▼

asked Mar 11 '14 at 02:55 AM in Blueprint Scripting

avatar image

ue4-archive ♦♦ STAFF
50k 3670 2000 9124

avatar image The Cheese Dragon Dec 05 '14 at 12:15 AM

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

avatar image LemonInGintonic Sep 14 '15 at 03:36 PM

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

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

The question has been closed Sep 14 '15 at 07:01 PM by Adam Davis for the following reason:

The question is answered, right answer was accepted


1 answer: sort voted first

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 :)

Rama

alt text

timeofimpact.png (130.7 kB)
forceofimpact.jpg (97.9 kB)
more ▼

answered Mar 11 '14 at 02:55 AM

avatar image

ue4-archive ♦♦ STAFF
50k 3670 2000 9124

avatar image ue4-archive ♦♦ STAFF Mar 11 '14 at 02:56 AM

Thank you so much! The "Vector Length" function was what I've been looking for for a while

avatar image ue4-archive ♦♦ STAFF Mar 11 '14 at 02:56 AM

I updated my pic, see the new pic it's even better :)

actual FORCE by getting the MASS as well :)

avatar image ue4-archive ♦♦ STAFF Mar 11 '14 at 02:56 AM

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..

avatar image ue4-archive ♦♦ STAFF Mar 11 '14 at 02:56 AM

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

:)

Rama

avatar image ue4-archive ♦♦ STAFF Mar 11 '14 at 02:56 AM

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

alt text

avatar image ue4-archive ♦♦ STAFF Mar 11 '14 at 02:56 AM

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?

avatar image ue4-archive ♦♦ STAFF Mar 11 '14 at 02:56 AM

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

avatar image ue4-archive ♦♦ STAFF Mar 11 '14 at 02:56 AM

Yay!

Congrats on getting it working!

avatar image 0vr May 05 '14 at 04:18 AM

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.

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

Follow this question

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

Answers to this question