Destroy(bool, int)
Destroy the shape, destroying all PhysicsShape.Contact the shape is involved in. If the object is owned with PhysicsShape.SetOwner then you must provide the owner key it returned. Failing to do so will return a warning and the shape will not be destroyed. The lifetime of the specified owner object
Read time 1 minuteLast updated 9 hours ago
Definition
- Type: Method
- Namespace: Unity.U2D.Physics
- Assembly: UnityEngine.PhysicsCore2DModule
public bool Destroy(bool updateBodyMass = true, int ownerKey = 0)
Parameters
Optional flag indicating if the body mass configuration should be updated. Not doing so is faster, especially when destroying multiple shapes.
Optional owner key returned when using PhysicsShape.SetOwner.
Returns
Type | Description |
|---|---|
| bool | If the shape was destroyed or not. |