# traceres.FractionLeftSolid Is Broken

The trace result data “FractionLeftSolid” is supposed to calculate when the trace left the solid it started in, as a fraction of the total trace length. I tried using this function with every trace function on the wiki, using many different combinations of filters and masks, and I could not get it to work. When a trace hits a solid object, it stops. So when a trace starts in a solid object, it doesn’t go anywhere, and can’t determine when it left the solid. From what I can tell, Traces cannot leave solids.

If i’m missing something or you have a solution, please respond. Thanks

edit: Below is a simple testing SWEP I made to see if anything works. It scrolls through every collision type, and for each collision type, draws a trace for each mask type and prints the FractionLeftSolid. I ended up with 441 zeros in the console.

[swep code swep code swep code blah blah blah]

function SWEP:Initialize()

end

local function IsExistant(input)
if IsValid(input) and input:IsValid() and input != nil and !input:IsWorld() then
return true
else
return false
end
end

local testtab = {}

function SWEP:PrimaryAttack() // Selects the entities.
local ent = self.Owner:GetEyeTrace().Entity
if !IsExistant(ent) then return end

``````if table.Count(testtab) &lt; 2 then
table.insert(testtab, ent)
print("Entity "..ent:EntIndex().." selected!")
print("  Position: "..tostring(ent:GetPos()))
end
``````

end

function SWEP:SecondaryAttack() // Scrolls through every collision type and, for each collision type, creates a trace for each mask type.
if table.Count(testtab) != 2 then return end

``````for i = 0, 20 do
testtab[1]:SetCollisionGroup(i)

for j = 1, 21 do
local tracedata = {}
tracedata.start = testtab[1]:GetPos()
tracedata.endpos = testtab[2]:GetPos()