# DestroyJointBatch

> Destroy a batch of joints. Any invalid joints will be ignored. Owned joints will produce a warning and will not be destroyed ( PhysicsJoint.SetOwner ).

## Definition

* **Type:** Method
* **Namespace:** [Unity.U2D.Physics](/engine/6000.7/script-reference/unity/u2d/physics.md)
* **Assembly:** UnityEngine.PhysicsCore2DModule

## DestroyJointBatch(ReadOnlySpan\<PhysicsJoint>)

Destroy a batch of joints. Any invalid joints will be ignored. Owned joints will produce a warning and will not be destroyed ([PhysicsJoint.SetOwner](/engine/6000.7/script-reference/unity/u2d/physics/physicsjoint/setowner.md)).

```csharp
public static void DestroyJointBatch(ReadOnlySpan<PhysicsJoint> joints)
```

### Parameters

**** (\[ReadOnlySpan\<PhysicsJoint>]\(https\://learn.microsoft.com/dotnet/api/system.readonlyspan-1)): The joints to destroy.

## DestroyJointBatch(ReadOnlySpan\<PhysicsJoint>, int)

Destroy a batch of joints. Any invalid joints are ignored. A joint owned by a different owner key is skipped and left valid; a joint with no owner, or one matching the given owner key, is destroyed. One summary warning reports how many joints were skipped this way, rather than one warning per joint.

```csharp
public static void DestroyJointBatch(ReadOnlySpan<PhysicsJoint> joints, int ownerKey)
```

### Parameters

**** (\[ReadOnlySpan\<PhysicsJoint>]\(https\://learn.microsoft.com/dotnet/api/system.readonlyspan-1)): The joints to destroy.**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): Optional owner key returned when using [PhysicsJoint.SetOwner](/engine/6000.7/script-reference/unity/u2d/physics/physicsjoint/setowner.md).

### Remarks

See [PhysicsJoint.SetOwner](/engine/6000.7/script-reference/unity/u2d/physics/physicsjoint/setowner.md).
