Ragdoll trace

Is there any way to return Non-collide ragdoll by trace?



function SWEP:PrimaryAttack( )
	local pos = self.Owner:GetShootPos()
	local ang = self.Owner:GetAimVector()
	local tracedata = {}
	tracedata.start = pos
	tracedata.endpos = pos+(ang*80)
	tracedata.filter = self.Owner
	local trace = util.TraceLine(tracedata)
	if trace.HitNonWorld then
	   target = trace.Entity
	   if target:IsValid() then
			target:Remove()
		end
	end
	
end


This can destroy anything but no non-collide ragdolls. Why?

The so called “Non-collidable ragdolls” are clientside and do not exists on the server.

So how to destroy/hide them clientside?

Entity(Indexofit):Remove()

I think you’d have to do a trace on the client, which would simply entail rewriting the trace to work in the client-side .lua file (or IF CLIENT in the shared file for mavericks) aswell.
…but, I’ve never tested it, I’m probably wrong. Oh, and if it works it will probably only remove the ragdoll for the player using the SWep.

If the ragdoll is clientside, and the PrimaryAttack function was in shared.lua, then there should be no problems.

I think the ragdoll ignores traces, you can use ent.GetAll() and filter through the ragdoll entities clientside (They are not called prop_ragdoll).