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"

Event Hit - Normal Impulse is always zero

Brand new to UE4. I'm listening with an "Event Hit" node for collisions between my Actor and the player character. The event fires when the player jumps and lands on the actor, but the normal impulse vector is always (0, 0, 0). Could this be a collision configuration issue or is there some type of mass assignment I need to do?

Product Version: Not Selected
Tags:
more ▼

asked Aug 09 '14 at 10:05 PM in Blueprint Scripting

avatar image

tnunamak
10 1 1 3

avatar image kylawl Sep 24 '14 at 06:36 PM

Did you ever figure this out?

avatar image Adam Davis STAFF Sep 24 '14 at 08:32 PM

Hi everyone,

Can you post a screenshot of what your nodes look like? I might be able to see what is happening and how to address it. Thank you!

avatar image kylawl Sep 24 '14 at 08:44 PM

If you bump a character into a physics actor, the EventHit node on the physics actor will have a NormalImpulse of 0,0,0.

The only node you need is EventHit.

avatar image Adam Davis STAFF Sep 26 '14 at 05:40 PM

Hi kylawl,

The question is what are you running off of the event hit to test the normal impulse? Can I see how you have it set up so I might be able to figure out what is occurring?

avatar image kylawl Sep 26 '14 at 07:09 PM

You can give this a shot.

Thanks

/ Kyle

alt text

example.png (50.4 kB)
avatar image The Cheese Dragon Dec 05 '14 at 12:52 AM

I am using a character blueprint so I cant use the normal impulse pin but if I were to make my own how would you deal more damage on direct impacts, ie traveling towards a wall at 90 degrees to the wall would do more damage than doing a glancing hit?

avatar image AdrielKinn Aug 01 '15 at 06:05 AM

The dot product of the Hit Normal and your character's velocity will give you a number between your characters Speed and 0. That should do it.

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

5 answers: sort voted first

Hi all,

This is returning 0 right now because the character controller is not actually simulated. We're talking about the best way to solve this in a general way so that we give you a reliable impulse. It gets a little complicated when you consider all cases.

However, for your case specifically you could manually compute the impulse by calling GetVelocity on the actor that's moving and multiply it by its mass which you can get by calling GetMass.

Hope that helps, let me know if you run into more issues. Hopefully we'll get a proper solution soon

more ▼

answered Oct 09 '14 at 07:30 PM

avatar image

[Epic]Ori Cohen STAFF
1.4k 25 14 59

avatar image The Cheese Dragon Dec 05 '14 at 03:38 PM

what would you multiply the velocity by to make it do more damage on direct hits and less if you hit something at an angle?

is there a node for this?

avatar image Jin_VE May 29 '17 at 09:44 PM

I know this is old but for completion... You would want to use the velocity vector (normalized) and the surface normal (inverted) to get the angle between them. The closer the angle is to zero, the more head-on the impact was. http://www.wikihow.com/Find-the-Angle-Between-Two-Vectors

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

Hey everyone,

We were able to reproduce this issue on our end and have entered a bug report, TTP# 348357 to be assessed by the development staff.

Cheers

more ▼

answered Oct 01 '14 at 06:59 PM

avatar image

Rudy Q ♦♦ STAFF
47.3k 545 132 525

avatar image AllJonasNeeds Sep 20 '15 at 04:32 PM

Is this interaction still bugged or has it been fixed? I am not getting a normal impulse other than 0,0,0 in ue4.9 for a custom event assigned to an actor hit event on a character class and it would be good to know if this is my fault or caused by this bug.

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

I have worked out how to do what I asked originally, if anyone is interested.

so if you want to get a realistic collision force for damage you might want to multiply by the mass if you have objects of different sizes but more importantly you can multiply the velocity by the impact normal and get the length of that so for example in a car game you would take more damage from hitting a wall you are driving towards than if you glance off a wall running almost parallel to the direction you are travelling.

more ▼

answered Dec 09 '14 at 07:24 PM

avatar image

The Cheese Dragon
191 8 11 34

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

Hi kylawl,

I think what you are looking for is the impact normal. If you are wanting to register the exact location that the player hit, use the impact normal and it should return the values you are looking for.

more ▼

answered Sep 26 '14 at 07:32 PM

avatar image kylawl Sep 26 '14 at 08:42 PM

I'm actually trying to get the normal impulse because i need the force of the impact.

But It seems to be giving us some results now. Not sure what we did but it works now anyway.

Thanks

/ Kyle

avatar image kylawl Sep 30 '14 at 11:51 PM

Actually this still doesn't work. A Capsule driven by a CharacterMovementComponent will generate hit events without any NormalImpulse

avatar image Adam Davis STAFF Sep 30 '14 at 11:57 PM

Can you show me how you are calculating the normal impulse? Perhaps I can see a way in which you can see what you are looking for.

avatar image kylawl Oct 01 '14 at 05:23 PM

alt text Something like this is what we're trying to do.

avatar image Adam Davis STAFF Oct 01 '14 at 05:43 PM

Run a print string and plug the normal impulse directly into that. Does this register anything other than 0,0,0?

avatar image kylawl Oct 01 '14 at 05:47 PM

Yes it's always zero.

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

Make sure "simulation generates hit event " is activated, of course simulate physics already have to be active too.

alt text

help_01.png (5.2 kB)
more ▼

answered Oct 05 '14 at 03:48 PM

avatar image

osakaro
90 3 8 18

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

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

Answers to this question