isTouching
isTouching(
source,entity,options?):boolean
Whether any of entity’s colliders overlaps, or lies within 2 cm of, a
collider the filter meets, or the one entity other names, which it
meets even as a trigger: so a character standing on lava touches it,
though her capsule floats a centimetre above. What a predicted system
asks, which reads no contact or trigger event: a re-run steps no world.
False for an entity whose body is not built yet.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
source |
QuerySource |
entity |
Entity |
options |
IsTouchingOptions |
Returns
Section titled “Returns”boolean
Example
Section titled “Example”if (isTouching(step, character, { collisionMask: [hazards.collisionLayers.lava], includeTriggers: true })) burn(character);