# sm.unit.createUnit

Creates a new unit of type from an [Uuid](../Game-Script-Environment/Userdata/Uuid.md)

**Kind:** Function

**Environments:** Game

## Game

``` { .lua .api-signature }
sm.unit.createUnit( uuid, feetPos, yaw?, data?, pitch?, visible? )
```

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

**Availability:** Server only

**Parameters:**

| Name | Type | Description |
| --- | --- | --- |
| `uuid` | [Uuid](../Game-Script-Environment/Userdata/Uuid.md) | The character type uuid. |
| `feetPos` | [Vec3](../Game-Script-Environment/Userdata/Vec3.md) | The feet position in world where unit should spawn. |
| `yaw` *(optional)* | number | The initial yaw. Defaults to 0 (Optional) |
| `data` *(optional)* | any | The param data. (Optional) |
| `pitch` *(optional)* | number | The initial pitch. Defaults to 0 (Optional) |
| `visible` *(optional)* | boolean | Whether the unit is visible on spawn. Defaults to true. (Optional) |

**Returns:**

| Type | Description |
| --- | --- |
| [Unit](../Game-Script-Environment/Userdata/Unit.md) | The created unit. |
