# SyncShapes

> Refresh every proxy from its shape, updating each proxy AABB and categories to match the live shape. This only applies to a space bound to a world. A proxy whose shape has been destroyed since it was added is skipped and reported with a single warning.

## Definition

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

## SyncShapes()

Refresh every proxy from its shape, updating each proxy AABB and categories to match the live shape. This only applies to a space bound to a world. A proxy whose shape has been destroyed since it was added is skipped and reported with a single warning.

```csharp
public int SyncShapes()
```

### Returns

| Type                                                       | Description                             |
| ---------------------------------------------------------- | --------------------------------------- |
| [int](https://learn.microsoft.com/dotnet/api/system.int32) | The number of proxies that were synced. |

### Remarks

See [PhysicsSpace.Create](/engine/6000.7/script-reference/unity/u2d/physics/physicsspace/create.md) and [\_sourceWorld](/engine/6000.7/script-reference/unity/u2d/physics/physicsspace/sourceworld.md).

## SyncShapes(ReadOnlySpan\<ProxyHandle>)

Refresh the specified proxies from their shapes, updating each proxy AABB and categories to match the live shape. This only applies to a space bound to a world. An invalid proxy handle, or a proxy whose shape has been destroyed, is skipped and reported with a single warning.

```csharp
public int SyncShapes(ReadOnlySpan<PhysicsSpace.ProxyHandle> proxyHandles)
```

### Parameters

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

### Returns

| Type                                                       | Description                             |
| ---------------------------------------------------------- | --------------------------------------- |
| [int](https://learn.microsoft.com/dotnet/api/system.int32) | The number of proxies that were synced. |

### Remarks

See [PhysicsSpace.Create](/engine/6000.7/script-reference/unity/u2d/physics/physicsspace/create.md) and [\_sourceWorld](/engine/6000.7/script-reference/unity/u2d/physics/physicsspace/sourceworld.md).

## SyncShapes(ProxyHandle)

Refresh a single proxy from its shape, updating the proxy AABB and categories to match the live shape. This only applies to a space bound to a world. The proxy is skipped if its handle is invalid or its shape has been destroyed.

```csharp
public int SyncShapes(PhysicsSpace.ProxyHandle proxyHandle)
```

### Parameters

**** (\[ProxyHandle]\(/engine/6000.7/script-reference/unity/u2d/physics/physicsspace/proxyhandle)): The proxy to sync.

### Returns

| Type                                                       | Description                                      |
| ---------------------------------------------------------- | ------------------------------------------------ |
| [int](https://learn.microsoft.com/dotnet/api/system.int32) | The number of proxies that were synced (0 or 1). |

### Remarks

See [PhysicsSpace.Create](/engine/6000.7/script-reference/unity/u2d/physics/physicsspace/create.md) and [\_sourceWorld](/engine/6000.7/script-reference/unity/u2d/physics/physicsspace/sourceworld.md).
