SpecsInteractionModule.Overlap
ClassOne collider inside an overlap probe's volume, with an id stable from the enter to the exit of that membership.
- Snapchat: not supported
- SPECS: fully supported
- Camera Kit Web: not supported
- Camera Kit Mobile: not supported
- SnapchatNot supported — Available on SPECS only
- SPECSFully supported
- Camera Kit WebNot supported — Available on SPECS only
- Camera Kit MobileNot supported — Available on SPECS only
Since Lens Scripting v375
One collider inside an overlap probe's volume, with an id stable from the enter to
the exit of that membership. Delivered via OverlapEnterEventArgs#enteredOverlaps
and OverlapExitEventArgs#exitedOverlaps.
Index
Example
probe.onOverlapEnter.add(function (args) {
args.enteredOverlaps.forEach(function (overlap) {
if (overlap.collider) {
print("entered " + overlap.id + ": " + overlap.collider.getSceneObject().name);
}
});
});
Extends
Properties
collider
readonlycollider:ColliderComponent
SPECS
The collider. Null in OverlapProbe#onOverlapExit if the collider was destroyed while a member; use Overlap#id to correlate the exit with its enter.
Since
Lens Scripting Version 375
distance
readonlydistance:number
SPECS
Closest-point distance from the collider's volume to the probe center, in centimeters; 0 when
the probe center is inside the collider. -1 unless the probe was created with
SpecsInteractionModule.OverlapProbeOptions#trackDistances enabled.
This Overlap is a live view, not a snapshot: while the collider stays inside a
distance-tracking probe, the value refreshes in place once per frame at the probe's overlap
evaluation (after Update, before LateUpdate), so read it in LateUpdate for
current-frame-accurate results. Retain the Overlap from
OverlapProbe#onOverlapEnter and poll this property; it resets to -1 when the
membership exits (including during the OverlapProbe#onOverlapExit callback), so a
retained Overlap never reads as still-near after leaving.
Since
Lens Scripting Version 375
id
readonlyid:number
SPECS
Identifies this membership, stable from its enter to its exit and unique among the probe's concurrent memberships. Use it to pair an exit with its enter.
Since
Lens Scripting Version 375
Methods
getTypeName()
staticgetTypeName():TypeName<Overlap>
SPECS
Returns the fully-qualified JavaScript type name for this class (for example, "Component.Camera"). This is a static accessor (no instance required) and returns the same value as the instance getTypeName().
Returns
TypeName<Overlap>
Since
Lens Scripting Version 375
Overrides
getTypeName()
getTypeName():
string
Returns the name of this object's type.
Returns
string
Inherited from
isOfType()
isOfType(
type):boolean
Returns true if the object matches or derives from the passed in type.
Parameters
| Parameter | Type |
|---|---|
type | string |
Returns
boolean
Inherited from
isSame()
isSame(
other):boolean
Returns true if this object is the same as other. Useful for checking if two references point to the same thing.
Parameters
| Parameter | Type |
|---|---|
other | ScriptObject |
Returns
boolean