#Weird raycast blacklist eheh

15 messages · Page 1 of 1 (latest)

stark rune
#

Why does the blacklist ignore what I insert into the table ("Filter") each time I add an instance?
like :

--
local Filter = {}
local RaycastPar = RaycastParams.new()
RaycastPar.FilterDescendantsInstances = Filter
RaycastPar.FilterType = Enum.RaycastFilterType.Exclude
--
--
local Raycast = workspace:Raycast(Start, Direction, RaycastPar) -- Just ignore new instances in "Filter"
--
local NewPart = Instance.new("Part", workspace)
table.insert(Filter, PuddlePart)
--
game:GetService("Players").PlayerAdded:Connect(function(Plr)
    Plr.CharacterAdded:Connect(function(Char)
        table.insert(Filter, Char)
    end)
end)
--
while task.wait(2) do
    for _, Value in pairs(Filter) do
        print(Value) -- Print nothing >>:(
     end
end
--
#

D:

gentle sierra
#

It shouldn't be printing nothing 🤔

#

But understand that the table assigned to RaycastParams.FilterDescendantsInstances is shallow-copied

#

Updating the Filter table won't change anything

stark rune
gentle sierra
gentle sierra
#

FYI, you should clear that table of dead characters

stark rune
#

I will take care of the memory optimization of the game once I find a solution to add instances to the table.

gentle sierra
stark rune
#

thanks anyway

gentle sierra