The information on this page may no longer be accurate. To see the latest, go to our new and improved documentation. You can also learn more about the future of documentation.
Collapse Sidebar


GetPartBoundsInRadius returns an array of parts whose bounding boxes overlap a sphere whose volume is described using the given center (Vector3) and radius (number).

Beware that this spatial query function efficiently considers the volume of parts’ bounding boxes rather than their actual occupied volume. This may be important when considering cylinders, spheres, unions, and MeshPart, which have non-block shapes. For cases where accuracy particularly matters, use WorldRoot/GetPartsInPart|GetPartsInPart instead or further filter the results of this function yourself.

This function uses an datatype/OverlapParams object to describe reusable portions of the spatial query, such as an instance whitelist/blacklist, the maximum number of parts to query, and what articles/Collision Filtering|collision group to use. When making repeated spatial queries using functions like this, you should construct just one of these objects and reuse it.

This and other spatial query functions do not consider parts’ BasePart/CanCollide|CanCollide or BasePart/CanTouch|CanTouch properties. However, it will consider parts’ collision group if specified by the given OverlapParams.


Name Type Default Description

The location of the center of the given sphere volume to be queried

The radius of the given sphere volume to be queried

OverlapParams{MaxParts=false, BruteForceAllSlow=false, CollisionGroup=Default, FilterDescendantsInstances={}}

Contains reusable portions of the spatial query parameters


Return Type Summary

An array of BasePart which matched the spatial query