How to get a list of object at a specified position?

Russian

Как получить список объектов в заданной позиции мира?

How to get a list of desks at a specified position?

Russian

В указанном примере должен быть список из {Part1,Part2, Part4}

In the given example, there should be a list of {Part1, Part2, Part4}

Scrip for touch part:

t = script.Parent
warn( t:GetTouchingParts())

https://developer.roblox.com/en-us/api-reference/function/BasePart/GetTouchingParts

Russian

Но это не работает, если объекты проникаемые - Cancollide = false

But it doesn’t work if objects are penetrable - Cancollide = false

image

Russian

Сам спросил, сам и ответил.

I asked myself and answered myself.

Also:

t = script.Parent

local connection = t.Touched:Connect(function() end)
warn("Hack**********************")
warn( t:GetTouchingParts())
connection:Disconnect()

print(1,3,4)

local filterObjects = {}
local boxPosition = CFrame.new(0,4,0)
local boxSize = Vector3.new(1,1,1)
local maxObjectsAllowed = 0
local params = OverlapParams.new(filterObjects,Enum.RaycastFilterType.Blacklist,maxObjectsAllowed,"Default")
local objectsInSpace = workspace:GetPartBoundsInBox(boxPosition,boxSize,params)
print("GetPartBoundsInBox************************")
print(objectsInSpace)

local filterObjects = {t}
local boxPosition = t.CFrame
local boxSize = t.Size
local maxObjectsAllowed = 0
local params = OverlapParams.new(filterObjects,Enum.RaycastFilterType.Blacklist,maxObjectsAllowed,"Default")
local objectsInSpace = workspace:GetPartBoundsInBox(boxPosition,boxSize,params)
warn("GetPartBoundsInBox******************Filtered")
warn(objectsInSpace)

local objectsInSpace = workspace:GetPartsInPart(t,params)
print("GetPartsInPart************************")
print(objectsInSpace)

Косяк в описании функции!!!
И его решение: