Description

Args used for ColliderComponent.onOverlapEnter, which is triggered when the collider begins overlapping another object. Typically used for volume triggers.

Example

// When the collider begins to overlap another collider, print information about the overlap

// @input Physics.ColliderComponent collider

script.collider.onOverlapEnter.add(function (e) {
var overlap = e.overlap;
print("OverlapEnter(" + overlap.id + "): Overlap with: " + overlap.collider.getSceneObject().name);
});
interface OverlapEnterEventArgs {
    currentOverlapCount: number;
    currentOverlaps: Overlap[];
    overlap: Overlap;
    getTypeName(): string;
    isOfType(type): boolean;
    isSame(other): boolean;
}

Hierarchy (view full)

Properties

currentOverlapCount: number

Description

Number of objects currently overlapping.

currentOverlaps: Overlap[]

Description

Array of all current overlaps.

overlap: Overlap

Description

Structure containing information about the current overlap.

Methods

  • Returns string

    Description

    Returns the name of this object's type.

  • Parameters

    • type: string

    Returns boolean

    Description

    Returns true if the object matches or derives from the passed in type.

  • Parameters

    Returns boolean

    Description

    Returns true if this object is the same as other. Useful for checking if two references point to the same thing.

Generated using TypeDoc