In the attached screen shot it shows that I am attempting to asign an object in the workspace to the FilterDescendantsInstances part of the OverlapParams variable but I get the unable to cast value to objects.
Anyone help me get this sorted as I am stuck.
FilterDescendantsIntances works on a table ( i think, i don’t know overlap params )
{game.Workspace.BlockField}
1 Like
You need to assign a table of instances to filter.
OverlapParameters.FilterDescendantsInstances = {Model1, Model2}
1 Like
local regionSize = block.Size.X*1.7
local BotPos = Vector3.new(Bot.MainPart.position.x,Bot.MainPart.position.y,Bot.MainPart.position.z)
local block4BotPoint1 = BotPos + Vector3.new(-regionSize,0,-regionSize)
local block4BotPoint2 = BotPos + Vector3.new(regionSize,0,regionSize)
local block4BotRegion = Region3.new(block4BotPoint1,block4BotPoint2)
local blocks = blockField:GetChildren()
ovParams.FilterDescendantsInstances = blocks
for j,Part in pairs(workspace:GetPartBoundsInBox(block4BotRegion.CFrame,block4BotRegion.Size,ovParams)) do
I changed the location of where I asign the filter value and set it to the children of the blockfield. I was hoping I could get a list of the blocks from the region3.
Now I do not get the asign error but I do not get any hits.
And
A problem with getting all the children will become a performance problem later in the game as the blockfield is expanded after the identified blocks get destroyed.