Find the closest bone to the impact point

Hey! I need something more exact than the capsule collider attached to my character since I want to apply a physic blend to my animations where the character is hit by another character. I tried hit event detection based from the physic asset,which works great when I punch static meshes, but whenever I’m hitting another skeletal mesh, the collision isn’t detected. I kind of gave up on the hit event after that.
Now i’m trying to do it with overlap events. When my mesh overlaps the other skeletal mesh, I get the event! The problem is that the 2 components involved in the event are the whole skeletal-meshes, not bones or socket. I have the hit location though! Any idea how I could get the 2 bones (one from each mesh) involved in the collision?

To get the closest bone to a given location you would need to iterate through all the bone locations of the character then check and return the one with the closest distance.

example (untested):

This is truely amazing, thanks a lot.

I’ve added socket to each of my bones, and i’m having some troubles. I’ve copied your bp exemple.
Here are some weird behavior

Everything works when i’m on this side of the target

Foot is the winner everytime on this side of the target.Punches are still the triggers though!

Here is the vector i’m using for the impact point

I’ve tried using “impact point” as well, same results.

Try to debug the hit location to see if it’s actually at the correct impact point.

This is so weird, here is the impact point… the square in the background near the table. It is kinda where I spawn
f1e078dfd64fd5f5519cd43deceacf7e5b2ec9f8.jpeg

EDIT
The impact position is always 0,0,0 … Even when I change my spawn position. Is there a way to get the actual impact position?

Did you get any further with this? I’m after just about the same thing. I’m making a level where the player will shoot a bow against opponents and I want to attach arrows to the closest I can get to the actual hit locations. I’ve placed and named sockets to each possible hit location, bit I need a way to find the one closest to the actual hit so that I can attach it to that point on the enemy.

Check Rama’s blueprint plugins, I remember reading about one of his nodes that does exactly this.

Anybody can please give a project with that topic for learning?

Very late to the party on this one, but was just scrolling through and noticed the whole “foot” thing - is it because you’re getting the actors location, while would be at the bottom of the character capsule, which would then make the foot the nearest bone. You need to be getting the impact location, not the hit actor location

EDIT: Only looked at screenshots, not actual text. Looks like your hit location isn’t returning or being assigned properly, just returning a default constructed FVector.

Ok guys, stop it :]
Just use

**FindClosestBone()

Both in BP or C++

https://api.unrealengine.com/INT/API…one/index.html

7 Likes