# sm.portal.transferBToB

Transfers objects inside one B opening to the B opening of another portal.

**Kind:** Function

**Environments:** Game

## Game

``` { .lua .api-signature }
sm.portal.transferBToB( fromPortal, toPortal, filter? )
```

[Open the full Game reference](../Game-Script-Environment/Static-Functions/sm.portal.md#transferbtob)

**Availability:** Server only

Can be used to make elevators with several floors.

Portal sizes and opening A must match (world, position and rotation).

**Parameters:**

| Name | Type | Description |
| --- | --- | --- |
| `fromPortal` | [Portal](../Game-Script-Environment/Userdata/Portal.md) | The portal to transfer from. |
| `toPortal` | [Portal](../Game-Script-Environment/Userdata/Portal.md) | The portal to transfer to. |
| `filter` *(optional)* | integer | A [sm.physics.filter](../Game-Script-Environment/Static-Functions/sm.physics.md#filter) mask selecting which contents to transfer. Only [dynamicBody](../Game-Script-Environment/Static-Functions/sm.physics.md#filter), [staticBody](../Game-Script-Environment/Static-Functions/sm.physics.md#filter) and [character](../Game-Script-Environment/Static-Functions/sm.physics.md#filter) are meaningful. Defaults to transferring bodies and characters. (Optional) |

**Returns:**

| Type | Description |
| --- | --- |
| boolean | True if successful, false on failure. |
