Description
The LocalBounds
property of the Collider
class provides the calculated local bounds of all physics shapes within this collider. This property is useful for understanding the spatial extent of the collider in local space, which can be critical for collision detection and physics calculations.
Usage
To access the LocalBounds
property, you need to have an instance of a Collider
or a derived class. This property is read-only and provides a BBox
object representing the bounds.
Example
// Assuming 'collider' is an instance of a Collider or a derived class
BBox bounds = collider.LocalBounds;
// Use the bounds for further calculations or logic
Vector3 size = bounds.Size;
Vector3 center = bounds.Center;