Skip to main content
Skip to main content

addTrigger

addTrigger

Description

Add trigger to a rigid body shape

Definition

addTrigger(entityId triggerNodeId, string callbackFunctionName, object? callbackTarget, boolean? reportOnStay, object? callbackFunction)

Arguments

entityIdtriggerNodeId
stringcallbackFunctionNamecallback(entityId triggerId, entityId otherId, boolean onEnter, boolean onLeave, boolean onStay, entityId otherShapeId, integer subShapeIndex)
object?callbackTargettarget object [optional]
boolean?reportOnStayif true, the callback function is called every frame while an object is inside [optional, default=false]
object?callbackFunctiona function object that is called. If nil, callback is called by the 'callbackFunctionName' and 'callbackTarget' [optional, default=nil]

Return Values

integercallbackId