• Studio

  • Studio API

  • Bots

  • Web API

  • Designer Resources

  • Host Resources

  • Globals

    Bounds

    An axis-aligned bounding box. It acts as a simple container for a center position and the extents (further subdivided into size, min, max) of a box that can be used for collision detection, visibility testing, or other similar tasks in your game. Unity's Bounds Documentation

    Properties

    center

    ClientOnly

    Vector3 value that signifies the central point of the bounding box. Unity's Bounds.center Documentation

    extents

    ClientOnly

    Similar to size but it represents half the size of the bounding box in each dimension. This can be used when you need to measure from the center of the bounding box. Unity's Bounds.extents Documentation

    max

    ClientOnly

    The maximal value (upper-right-back corner) of the bounding box coordinates. Unity's Bounds.max Documentation

    min

    ClientOnly

    The minimum value (lower-left-front corner) of the bounding box coordinates. Unity's Bounds.min Documentation

    size

    ClientOnly

    The size of the bounding box for each dimension - how wide, tall, and deep it is. Unity's Bounds.size Documentation

    Methods

    ClosestPoint

    ClientOnly

    The closest point on or inside the bounding box to a given point. This can be helpful in figuring out how close an object is to entering a bounding box. Unity's Bounds.ClosestPoint Documentation

    Parameters

    point

    This is the location from which the closest point is determined.

    Returns

    Returns the closest point within or on the bounding box to the given point.

    Contains

    ClientOnly

    Check whether a specific point is within the current bounding box. Unity's Bounds.Contains Documentation

    Parameters

    point

    This is the point which you want to check.

    Returns

    boolean

    Returns true if the point is inside the bounding box, false otherwise.

    Encapsulate

    ClientOnly

    Grows the Bounds to include a point or bounds. You would typically use this when you have a set of points and you want a bounding box that encloses all these points. Unity's Bounds.Encapsulate Documentation

    Parameters

    bounds

    Returns

    void

    Encapsulate

    ClientOnly

    Grows the Bounds to include a point or bounds. You would typically use this when you have a set of points and you want a bounding box that encloses all these points. Unity's Bounds.Encapsulate Documentation

    Parameters

    point

    The new point to include within the bounding box.

    Returns

    void

    Equals

    ClientOnly

    Checks if two bounding boxes are equal in terms of their center and extents. Unity's Bounds.Equals Documentation

    Parameters

    other

    Returns

    boolean

    Expand

    ClientOnly

    Increases the size of the bounding box by the given amount (in both directions). Unity's Bounds.Expand Documentation

    Parameters

    amount

    The amount by which the bounding box should be expanded (shrank if negative).

    Returns

    void

    Expand

    ClientOnly

    Increases the size of the bounding box by the given amount (in both directions). Unity's Bounds.Expand Documentation

    Parameters

    amount
    number

    The amount by which the bounding box should be expanded (shrank if negative).

    Returns

    void

    IntersectRay

    ClientOnly

    Determines if a specified Ray intersects the bounds. This can prove vital in various game scenarios for interaction detection such as determining if a projectile is in range of an object or if a click or tap in screen space intersects a game object. It evaluates the intersection and returns true if the Ray intersects with the bounds, otherwise it returns false. Unity's Bounds.IntersectRay Documentation

    Parameters

    ray

    The Ray instance against which the intersection is to be checked.

    Returns

    boolean

    Returns true if the Ray intersects with the bounds, otherwise false.

    Intersects

    ClientOnly

    Checks whether the current bounding box intersects with another bounding box. You can use this to determine if two objects are likely to be colliding. Unity's Bounds.Intersects Documentation

    Parameters

    bounds

    The other bounding box to test intersection with.

    Returns

    boolean

    Returns true if the bounding boxes intersect, false otherwise.

    SetMinMax

    ClientOnly

    The minimum and maximum corners of the bounding box. Unity's Bounds.SetMinMax Documentation

    Parameters

    This specifies the smallest value for each coordinate of the bounding box.

    This represents the largest value for each coordinate of the bounding box.

    Returns

    void

    SqrDistance

    ClientOnly

    Returns the squared distance from a point to the bounding box. Squared distances can be useful for comparison without needing the computationally expensive square root operation. Unity's Bounds.SqrDistance Documentation

    Parameters

    point

    The point from which the distance is measured.

    Returns

    number

    Returns the squared distance from the bounding box to the point.

    Updated about 19 hours ago

    PocketWorlds Icon

    © 2025 Pocket Worlds. All rights reserved.