Box Overlap

Physics
Both Server and Client
Both Mobile and PC

Use a static box-shaped area for detection and return all entities within the box-shaped area. If the level parameter is filled in, the terrain can be detected.

Declaration

func BoxOverlap(halfExtents Vector3, center Vector3, rotation Vector3, layerMask List<int>, includeTrigger bool, out var hitEntities List<entity<Entity>>)
go

Parameters

Input

Name Type Description
Half Extents Vector3 Half the length of the three sides of the box area, only positive values are accepted
Center Vector3 Box area center point
Rotation Vector3 Box area rotation
Layer Mask ListT_int Layer mask, only the filled layers will participate in the scan, leaving it blank means all layers will participate in the scan
Include Trigger Bool Whether the trigger can be detected

Out

Name Type Description
Hit Entities ListT_Entity List of entities hit