Help identifying in which body part the projectile hit

Hey guys,

I’m working on a FPS, and I’m trying to apply a different amount of damage depending on the body part on which the bullet hit the other player.

I’m using FastCast but regardless, I’m essentially struggling a little bit with the RaycastResult.

I can easily identify when I hit a humanoid, but what I’m struggling is to identify which body part it was.

Even when I aim to the chest and see the projectile hitting the chest I get as the instance hit either HumanoidRootPart or Handle.

Would you guys have any tips or hints to get what I need?

Thanks in advance.

5 Likes

If you are using r15 you can add a server script and for each character added set canquery to humanoidrootpart to false so that the rays detect if it hit the uppertorso or lowertorso (sorry for bad english)

2 Likes

Thanks @P1po666,

Appreciate your answer, if you don’t mind me asking.

In case the player has accessories, such as shirts, armours, or whatever else, would this approach still work, would there be any side effects or something that I should know about turn canQuery off?

2 Likes

Quick update:

I’m using R15 Skinned Mesh, and it doesn’t look like I can turn canQuery on the HumanoidRootPart, although accessories I can turn off just fine. :frowning:

Any other ideas, suggestions or work arounds?

2 Likes

Add the HumanoidRootPart of other players and parts inside their tools to the FilterDescendants table of RaycastParams and set the FilterType to Blacklist.

2 Likes

Right, but that would need to done every time a player connects right?

Because I don’t think I can do that at the time my projectile a character.

Yes, when a play joins add their items and when they leave remove their items.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.