# Joint.getLength

Returns the current length of a piston. The length is measured in blocks.

**Kind:** Function

**Environments:** Game

## Game

``` { .lua .api-signature }
joint:getLength(  )
```

[Open the full Game reference](../Game-Script-Environment/Userdata/Joint.md#getlength)

**Parameters:**

| Name | Type | Description |
| --- | --- | --- |
| `piston` | [Joint](../Game-Script-Environment/Userdata/Joint.md) | The piston. |

**Returns:**

| Type | Description |
| --- | --- |
| number | The piston's current length in blocks. |
