How to prevent projectile from clipping through walls

Atm my projectile goes through walls. My idea was if not HitPlayer then destroy it, but that ends up destroying it immediately, as it hits an accessory or the tool itself, or whatever. How can I get it to destroy what it’s touched is not a player/child of a player

Projectile.Touched:Connect(function(hit)
	local Character = hit.Parent
	if not Character then return end
	
	local HitPlayer = Players:GetPlayerFromCharacter(Character)
	if not HitPlayer then return end -- Make sure it's an actual player
	
	if HitPlayer == player then return end
	
	PlayerHit:Play()
	CharacterHit(Character)
end)

Add a check to make sure its not a part of the player by using :GetDescendents, that way it gets every single part in the player, including the guns/accessories

Make sure the “hit” variable is not a child of the character by checking to see if a “Humanoid” is a child of the hit’s parent, since generally body parts and accessories are parented to the Character, and the Humanoid is always a descendant.