Whenever I shoot a player or even a dummy accessories it blocks the gun shots and not go through but if i shoot at body it shoots normally
The gun system can shoot the head if there was no accessories
Whenever I shoot a player or even a dummy accessories it blocks the gun shots and not go through but if i shoot at body it shoots normally
The gun system can shoot the head if there was no accessories
still looking for help^^^^^^^^^^^^
When the raycast hits a hat, add a if statement for if the RaycastResult.Instance’s parent or itself is an Accessory. Or you can add every player’s hat in the game to be excluded in the Raycast paramaters.
Look through accessories and add their handles to a blacklist, here’s a little part from my projectile module that deals with that problem.
local bullet = game.Lighting.Bullet:Clone()
local blacklist = { client.Character, viewmodel, bullet }
for _, players in pairs(game.Players:GetPlayers()) do
if players.Character then
for _, acc in pairs(players.Character:GetChildren()) do
if acc:IsA("Accessory") then
table.insert(blacklist, acc.Handle)
end
end
end
end
BlackListParams.FilterDescendantsInstances = blacklist
local resultRay = workspace:Raycast(bullet.Position, bullet.CFrame.LookVector * Speed * 7, BlackListParams)
I can give you the gun system copy so you can check it out
I can give you a copy of the gun system
I’m new to raycasting and not knowledgeable about them
Sure. Ill do it for ya.
bbbbbbbbbbbbbbbbbbbbbb
Inside your GunHandler Module, change the
--params for caster
local castParams = RaycastParams.new()
castParams.IgnoreWater = true
castParams.FilterType = Enum.RaycastFilterType.Exclude
castParams.FilterDescendantsInstances = blacklist
For
--Blacklist Accessories
local blacklist = {player.Character}
--
for _, acc in pairs(workspace:GetDescendants()) do
if acc:IsA("Accessory") then
table.insert(blacklist, acc.Handle)
end
end
--params for caster
local castParams = RaycastParams.new()
castParams.IgnoreWater = true
castParams.FilterType = Enum.RaycastFilterType.Exclude
castParams.FilterDescendantsInstances = blacklist
Let me know if it works.
I tested it out I see some difference and its better however it still doesn’t work properly, its same thing when I shoot the heat no damage
Strange, Are you sure the bullet is not getting blocked by something else that’s on the head?, because the script does what is supposed to do. Blacklisting every accessorie’s handles.
Nope, just the accessories same issue
Try checking framework in replicated storage
Let me know if you have found a solution for this
(Still didn’t resolve the issue, looking for help)
Hold on I see something, Whenever i shoot at an accessory the bullets go up I will send you a video
Hmm, Try and do the same to other raycast blacklists that are in the projectile module or something.
what do you mean, projectile?
bbbbbbbbbbbbb