Here's the problem: I'm trying to blacklist all parts that are non-collidable for my raycast weapon. I got the code that finds the blocks, and the codes that blacklists it, but it just won't fuse together. No matter what I do.
Here's the code I'm using:
local function Step(overrideDistance) -- Cast ray:
local descendants = workspace:GetDescendants()
for _, descendant in pairs(descendants) do -- Code that finds blocks that are non-collidalbe
if descendant:IsA("BasePart") then
if descendant.CanCollide == false then
return
end
end
end
local blackList = {script.Parent, workspace.TheBlueException} -- Blacklist code
local params = RaycastParams.new()
local direction = currentNormal * (overrideDistance or stepDistance)
params.FilterType = Enum.RaycastFilterType.Blacklist
params.FilterDescendantsInstances = blackList
local result = workspace:Raycast(currentPos, direction, params)
local pos
Hopefully this'll be enough information to see where the error lies. In any case, thank you for your time.
Oh nevermind. It turns out I needed to add this to the function
Basically, I added a new thing entirely called "PhysicsService". Using this, I was able to create a new collision group entirely, completely separate from the original "Default" collision group. This way the local descendants' job is now to add this new collision group to the bricks I want to be non-collidable with my raycast, replacing the original "Default" collision group in the process. Then, the raycast laser will automatically go through the new collision blocks, because they are not considered "Default" in the collision group.
tl;dr, I figured it out, lol.