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.
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")
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.
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.