Projectile touched event isn't triggering on humanoids, even while visually touching

So I have this brick in the game that you can throw and if it hits another player, it hurts them. Though I’m having this problem where it looks like the brick is hitting the humanoid, it visibly collides and bounces off, but it doesn’t show a collision with the humanoid in output when printing and it doesn’t run the event for hitting a humanoid.


Here’s the touched code for the brick. The brick does get enough velocity for it to hit properly and it constantly registers touches against the player who throws it, but for some reason it just doesn’t work against other humanoids half the time.

Any help is appreciated.

2 Likes

What do you mean by Humanoid?

HumanoidRootPart or actual Humanoid

1 Like

Well I mean, like just a humanoid as in a rig, another player, a NPC, not like the actual part. Not really sure what to refer to them as lol

2 Likes

This might be a solution, instead of checkhumanoid1 and checkhumanoid2 use this

local plr = game.Players:GetPlayerFromCharacter(hit.Parent)
local char = plr.Character or plr.CharacterAdded:Wait()
local humanoid = char:WaitForChild("Humanoid")
1 Like

Well that can work, but he’s testing with a Rig.

@XenoHobo You can try that testing with actual Players

btw use FindFirstChild() instead of WaitForChild() :pray:

2 Likes

I did test it with other players, and this new way to check for characters is better than what I was using before, but it still doesn’t work properly with either the rig or other players.

Also, not really sure why but for some reason, it almost never touches or hits if I throw it towards the back of the other player, only seems to work from the side or front most of the time, not really sure what’s happening.

2 Likes

probably could be this line:
image

Because HumanoidRootPart is fully transparent

2 Likes

I thought that had to be it, but nah, still doesn’t work after removing that condition.

2 Likes

You can use Raycasting to make sure the collision between the brick and the humanoid. Also check that the velocity of the brick is sufficient

Edit: I recommend using FindFirstChildOfClass("Humanoid") instead of FindFirstChild("Humanoid").

1 Like

I know of fast cast and shooting projectiles from a source with that, but I’m not sure how to do a ray cast if the brick is a physics object and will have velocity.

1 Like