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"

[Question] Colliding Mesh


So, I'm trying to get an effect, where when one of my characters swings at another character with their hand, it will decrease their health. (i.e. Punching, Slapping, Scratching them). My issue, is that I can only find Event Hit, and Event Overlap. And the mesh only has OnComponentOverlap (Which I believe is localized to the owning blueprint).

So, My question is, how do I check when a mesh of one character is colliding with another character, and how do i then determine which bone of the attacking character is colliding with the other character (To verify that they're attacking with their hands, and it's not like the foot bumping into them or something).

I'm trying to keep it all to blueprints for the time being. I've already tried a few things, But the best result I've managed to get is when the attacker bumps into the attacker, it decreases the health. Any help would be awesome.

Thanks, Nate

Product Version: Not Selected
more ▼

asked Mar 11 '14 at 03:48 AM in Using UE4

avatar image

ue4-archive ♦♦ STAFF
49.9k 3662 1986 9113

(comments are locked)
10|2000 characters needed characters left

2 answers: sort voted first

My Trace for Closest Bone Blueprint Node For You

I made a custom BP node to do exactly what you are asking,

and I also made BP nodes to make tracing from a character socket (the swinging hand) easy!

See my TraceData Nodes http://forums.epicgames.com/threads/977316-(21)-Rama-s-Blueprint-Node-Library-As-a-Plugin-For-You!-No-Code-Compile-Required?p=31719668&viewfull=1#post31719668

and my Trace for Closest Bone Node http://forums.epicgames.com/threads/977316-(17)-Rama-s-Blueprint-Node-Library-As-a-Plugin-For-You!-No-Code-Compile-Required?p=31719668&viewfull=1#post31719668

and just combine them !

alt text (my trace for socket and trace for bone nodes work the same way)

No C++ Required

My additional nodes are a plugin, and a very small download of about 6mb

Installation instructions and download link here: http://forums.epicgames.com/threads/977316-(36)Rama-s-Blueprint-Nodes-Plugin-For-You!-Set-Scene-Component-Mobility

Summary and Implementation

Use my TraceData node to trace from the socket of your character's skeletal Mesh hand a short distance, for the continuous duration of your swinging anim montage.

Use my TraceData nodes to Draw the Trace so you get a visual of what the short trace is doing

My Trace for Closest Bone will tell you when the character's hand is reaching an actual physical part of the other character's mesh, not just their capsule collision volume, and what exact bone was hit

You could stop doing the continuous tracing when the first bone name is returned by my function as a successful impact has occurred.

What Direction For Trace?

You can arrange a socket on your skel mesh at the fist location that is by default facing in the direction of the knuckles or claws or whatever

and then instead of using the Actor's Rotation as I use in the graph above, you can get the socket rotation of your Hand Socket, which will be accurate during the animation montage of swinging :)



more ▼

answered Mar 11 '14 at 03:48 AM

avatar image

ue4-archive ♦♦ STAFF
49.9k 3662 1986 9113

(comments are locked)
10|2000 characters needed characters left

Alternatively, attach a shape component - sphere or capsule preferably - to the hands of your mesh, then enable overlap events for them.

Once the overlap event happens, take the informatin provided to calculate the bone hit etc.

This can be done using the functions that Rama provided.

more ▼

answered Mar 11 '14 at 03:48 AM

avatar image

ue4-archive ♦♦ STAFF
49.9k 3662 1986 9113

(comments are locked)
10|2000 characters needed characters left
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