Exposes state generated for ColliderComponent overlap events. See also: ColliderComponent, OverlapEnterEventArgs, OverlapExitEventArgs, OverlapStayEventArgs.
// When the collider begins to overlap another collider, print information about the overlap// @input Physics.ColliderComponent colliderscript.collider.onOverlapEnter.add(function (e) { var overlap = e.overlap; print("OverlapEnter(" + overlap.id + "): Overlap with: " + overlap.collider.getSceneObject().name);}); Copy
// When the collider begins to overlap another collider, print information about the overlap// @input Physics.ColliderComponent colliderscript.collider.onOverlapEnter.add(function (e) { var overlap = e.overlap; print("OverlapEnter(" + overlap.id + "): Overlap with: " + overlap.collider.getSceneObject().name);});
Readonly
The collider which is overlapping.
ID of the overlap, unique for this overlap.
Returns the name of this object's type.
Returns true if the object matches or derives from the passed in type.
Returns true if this object is the same as other. Useful for checking if two references point to the same thing.
other
Exposes state generated for ColliderComponent overlap events. See also: ColliderComponent, OverlapEnterEventArgs, OverlapExitEventArgs, OverlapStayEventArgs.
Example