Args used for ColliderComponent.onCollisionEnter, which is triggered when a collision begins.

// Add a callback for onCollisionEnter on this collider

// @input Physics.ColliderComponent collider

script.collider.onCollisionEnter.add(function(eventArgs) {
var collision = eventArgs.collision;
print("CollisionEnter(" + collision.id + "): contacts=" + collision.contactCount + " ---> " + collision.collider.getSceneObject().name);
});
interface CollisionEnterEventArgs {
    collision: Collision;
    getTypeName(): string;
    isOfType(type: string): boolean;
    isSame(other: ScriptObject): boolean;
}

Hierarchy (view full)

Properties

collision: Collision

Structure containing information about the current collision.

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