Args used for ColliderComponent.onOverlapStay, which is triggered every frame while the collider continues overlapping another object. Typically used for volume triggers.

// While the collider continues to overlap another collider, print information about the overlap

// @input Physics.ColliderComponent collider

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

Hierarchy (view full)

Properties

currentOverlapCount: number

Number of objects currently overlapping.

currentOverlaps: Overlap[]

Array of all current overlaps.

overlap: Overlap

Structure containing information about the current overlap.

Methods

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

    Parameters

    • type: string

    Returns boolean

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

    Parameters

    Returns boolean