object:removeSelf()

Type Function
Object Joint
Library physics.*
Return value none
Revision Release 2024.3703
Keywords joint, removeSelf
See also display.remove()
Physics Joints (guide)

Overview

Destroys an existing joint and detaches the two joined bodies. This should not be called during a collision event — instead, set a flag or add a time delay so the destruction can occur in the next application cycle or later, for example via timer.performWithDelay().

Alternatively, you can destroy a joint via display.remove(), passing the joint reference as the sole argument.

Syntax

object:removeSelf()