# Unit.setWhiskerData

Sets the whisker data for obstacle avoidance

**Kind:** Function

**Environments:** Game

## Game

``` { .lua .api-signature }
unit:setWhiskerData( whiskerCount, maxAngle, startLength, endLength )
```

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

**Availability:** Server only

**Parameters:**

| Name | Type | Description |
| --- | --- | --- |
| `unit` | [Unit](../Game-Script-Environment/Userdata/Unit.md) | The unit. |
| `whiskerCount` | integer | The whiskerCount. |
| `maxAngle` | number | The maxAngle. |
| `startLength` | number | The startLength. |
| `endLength` | number | The endLength. |
