local z=require(script.Parent.Parent)local R=z.Misc.GetCharacterFromPart function Raycast(z,m)m=m or{}local C,q,N,J repeat C,q,N=workspace:FindPartOnRayWithIgnoreList(z,m)J=R(C)if C and(not C.CanCollide and not J)then table.insert(m,C)C=nil else return C,q,N end until C end return Raycast


local Utils = require(script.Parent.Parent);

local FindCharacterAncestor = Utils.Misc.GetCharacterFromPart;

function Raycast(lookRay, ignoreList)
	ignoreList = ignoreList or {};
    local target, point, normal, targetCharacter;
    repeat
        target, point, normal = workspace:FindPartOnRayWithIgnoreList(lookRay, ignoreList);
        targetCharacter = FindCharacterAncestor(target);
        if target and not target.CanCollide and not targetCharacter then
            table.insert(ignoreList, target);
            target = nil;
        else
			return target, point, normal;
        end
    until target;
end

return Raycast;
