Hi! Just having a bit of problems understanding how FilterDescendantsInstances is used.
Docos say;
array RaycastParams.FilterDescendantsInstances
An array of objects whose descendants will be used in filtering raycasting candidates
This is my code;
local raycastParams = RaycastParams.new()
raycastParams.FilterType = Enum.RaycastFilterType.Whitelist
-- 1. FAILS raycastParams.FilterDescendantsInstances = {workspace.fog1:GetChildren(), workspace.structures:GetChildren()}
-- 2. FAILS raycastParams.FilterDescendantsInstances = {workspace.fog1:GetChildren()}
-- 3. WORKS raycastParams.FilterDescendantsInstances = workspace.fog1:GetChildren()
-- 4. WORKS raycastParams.FilterDescendantsInstances = workspace.structures:GetChildren()
Lines 3 and 4 work as expected. I’ve omitted the raycast itself for brevity.
So a few questions;
a) why can’t I just use workspace.fog1 (it fails)? I have to pass workspace.fog1:GetChildren()(it works!). The documents say the “descendants” will be used, and the property itself is an array.
b) if I set a single object, eg lines 3 and 4, it works. If I wrap them in an array {}, it fails. Why? This causes the next problem…
c) How do I include the descendants of both folders (workspace.fog1 and workspace.structures) in my whitelist?
thanks