September 20, 2022


Map:BoxCast(center, extend, rotation)


Get the hit information of box detection. Performance worse thanMap:BoxCheck()


Variable name Type Describe
center Vector3 Box center point
extend Vector3 Side length of box type
rotation Vector3 The rotation direction of the box type is vector3 by default Zero

Return value

Type Describe
table<HitResult> A list of all detected hit information, each hit information contains information such as the instance of the hit, the distance of the hit, etc.

Code example

Check the current scene coordinates (0,0,0) on the client, and a list of instances of box detection hits per unit volume

local map = World.CurMap
local center =,0,0)
local halfExtend =,0.5,0.5)
local resultList = map:BoxCast(center, halfExtend)
for _, result in pairs(resultList) do