Weapon Bullet dosent register Torso shots. HumanoidRootPart Problem EDIT RAYCAST PROBLEM PLEASE HELP

Hello DevForum Community

I have a problem out of the blue my gun scripts dosent register player torso shots ?.
Ive tested around because i thouhg it was my gunback script wich creates a model around torso but i fixed that issue. I found out it was the HumanoidRootPart.

Here is a Video about my problem. Once i deleted humanoidRootPart the torso shots were registered.

All it does (i have a wallbang function) the shot goes through the player because the hit object is being scanned if his parent has a humanoid if yes then make the shot go through wich does it fine. However for some reason it dosent fire the event to the serversided script wich deals the damage to the player ?

Here is the portion of the script

elseif Hit.Parent:FindFirstChild("Humanoid") and Hit.Parent.Humanoid.Health == 0 or Hit.Parent:FindFirstChild("Humanoid") or Hit.Parent:FindFirstChild("Humanoid") and PiercedHumanoid[Hit.Parent.Humanoid] then
				if EndPos and Hit then
					Player.PlayerScripts.BulletVisualizerScript.Visualize:Fire(nil,ShootingHandle, Module.MuzzleOffset,EndPos,script.MuzzleEffect, script.HitEffects.Blood, Module.Blood_HitSound, {Module.ExplosiveEnabled,Module.BlastRadius,Module.BlastPressure},{Module.BulletSpeed,Module.BulletSize,Module.BulletColor,Module.BulletTransparency,Module.BulletMaterial,Module.FadeTime},false,PierceAvailable == -1 and Module.VisualizerEnabled or false, Hit, BulletRay)
					game.ReplicatedStorage.VisualizeBullet:FireServer(ShootingHandle, Module.MuzzleOffset,EndPos,script.MuzzleEffect, script.HitEffects.Blood, Module.Blood_HitSound, {Module.ExplosiveEnabled,Module.BlastRadius,Module.BlastPressure},{Module.BulletSpeed,Module.BulletSize,Module.BulletColor,Module.BulletTransparency,Module.BulletMaterial,Module.FadeTime},true,PierceAvailable == -1 and Module.VisualizerEnabled or false, Hit, BulletRay)
				    local decal = Instance.new("Decal")
                    local decal2 = Instance.new("Decal")
                    local decal3 = Instance.new("Decal")
                    local decal4 = Instance.new("Decal")
			     	decal.Texture = "rbxassetid://246162648"
					decal.Face = "Front"
					decal.Parent = Hit
					decal2.Texture = "rbxassetid://246162648"
					decal2.Face = "Back"
					decal2.Parent = Hit
					decal3.Face = "Left"
					decal3.Texture = "rbxassetid://246162648"
					decal3.Parent = Hit
					decal4.Parent = Hit
					decal4.Texture = "rbxassetid://246162648"
					decal4.Face = "Right"
				end --[[The Section above makes the bullet go through if Hit.Parent finds humanoid wich it does because the HumanoidRootPart is modelled togheter with the player]]--
				local TargetHumanoid = Hit.Parent:FindFirstChild("Humanoid")
				local TargetTorso = Hit.Parent:FindFirstChild("Torso")
				if TargetHumanoid and TargetHumanoid.Health > 0 and TargetTorso then
					InflictTarget:FireServer(TargetHumanoid, TargetTorso, (Hit.Name == "Head" and Module.HeadshotEnabled) and Module.BaseDamage * Module.HeadshotDamageMultiplier or Module.BaseDamage, Direction, Module.Knockback, Module.Lifesteal, Module.FlamingBullet, Hit)
					PiercedHumanoid[TargetHumanoid] = true
				end
				if AcceptedUnit == BulletUnit then
					Hit, EndPos = RayCast(EndPos+(BulletUnit*.01),BulletUnit,Range-((Start-EndPos).magnitude),Ignore)
				elseif AcceptedUnit == MouseUnit then
					Hit, EndPos = RayCast(EndPos+(Direction*.01),Direction,Range-((Start-EndPos).magnitude),Ignore)
				end
			end
		end```

EDIT: I also put a print in InflictTarget. When shooting HumanoidRootPart the event dosent get fired because the print dosent appear. But once i tested and i didnt move the player after he spawned the shot got registerd on torso so i belive it ether hit his arm or it sometimes hits the torso ???
1 Like

Did you place the guns/player accessories into an ignorelist? If you aren’t, then the raycasts are hitting those accessories and stopping instead of hitting the rootpart/torso.

oh yes when you already say that i also realized that when you shoot the players head and some hats are weird or are really close to the head then the same bug happens too.

How would i create such ignore list ? im using FE GunKit

EDIT: I have a bullet visulizer wich deals globaly with the raycasts

Cant really help you with that :man_shrugging:.

Normally though, for your raycast, the ending argument will be the rules/parameters for the raycast (if you’re doing workspace:Raycast() or just a table, including inside with the things you want to blacklist or whitelist, depending on the ray/api you’ve chosen.

if AcceptedUnit == BulletUnit then
					Hit, EndPos = RayCast(EndPos+(BulletUnit*.01),BulletUnit,Range-((Start-EndPos).magnitude),Ignore)
				elseif AcceptedUnit == MouseUnit then
					Hit, EndPos = RayCast(EndPos+(Direction*.01),Direction,Range-((Start-EndPos).magnitude),Ignore)
				end

this is the portion of the raycast creator if im not wrong right ? how would i add a ignore and at the end of the infomation it mentions “ignore”. Im confused how i would make it ignore certain objects im not good in raycast

I don’t know where the ignore list is located at/Ignore variable so I can’t really help you with that :man_shrugging:.

You can try searching around in your script thing for the kit of course. The ignore list is just an array with the objects included to be ignored.

I looked into it there is no ignore list :frowning: