# sm.projectile.projectileAttack

Perform a projectile attack

**Kind:** Function

**Environments:** Game

## Game

### Overload 1

``` { .lua .api-signature }
sm.projectile.projectileAttack(
    name,
    damage,
    position,
    velocity,
    source,
    fakePosThird?,
    fakePosFirst?,
    delay?
)
```

[Open the full Game reference](../Game-Script-Environment/Static-Functions/sm.projectile.md#projectileattack-string-integer-vec3-vec3-player-vec3-optional-vec3-optional-integer-optional)

> **Deprecated:**
> Name is deprecated, use uuid instead
>

**Parameters:**

| Name | Type | Description |
| --- | --- | --- |
| `name` | string | The projectile's name. |
| `damage` | integer | The damage the projectile will inflict. |
| `position` | [Vec3](../Game-Script-Environment/Userdata/Vec3.md) | The start position. |
| `velocity` | [Vec3](../Game-Script-Environment/Userdata/Vec3.md) | The direction and velocity. |
| `source` | [Player](../Game-Script-Environment/Userdata/Player.md) | The player that is the source of the projectile. |
| `fakePosThird` *(optional)* | [Vec3](../Game-Script-Environment/Userdata/Vec3.md) | The visual start position in third-person. (Defaults to position) |
| `fakePosFirst` *(optional)* | [Vec3](../Game-Script-Environment/Userdata/Vec3.md) | The visual start position in first-person. (Defaults to position) |
| `delay` *(optional)* | integer | The number of ticks before firing. (Defaults to 0) |

### Overload 2

``` { .lua .api-signature }
sm.projectile.projectileAttack(
    name,
    damage,
    position,
    velocity,
    source,
    fakePosThird?,
    fakePosFirst?,
    delay?
)
```

[Open the full Game reference](../Game-Script-Environment/Static-Functions/sm.projectile.md#projectileattack-string-integer-vec3-vec3-unit-vec3-optional-vec3-optional-integer-optional)

> **Deprecated:**
> Name is deprecated, use uuid instead
>

**Parameters:**

| Name | Type | Description |
| --- | --- | --- |
| `name` | string | The projectile's name. |
| `damage` | integer | The damage the projectile will inflict. |
| `position` | [Vec3](../Game-Script-Environment/Userdata/Vec3.md) | The start position. |
| `velocity` | [Vec3](../Game-Script-Environment/Userdata/Vec3.md) | The direction and velocity. |
| `source` | [Unit](../Game-Script-Environment/Userdata/Unit.md) | The Unit that is the source of the projectile. |
| `fakePosThird` *(optional)* | [Vec3](../Game-Script-Environment/Userdata/Vec3.md) | The visual start position in third-person. (Defaults to position) |
| `fakePosFirst` *(optional)* | [Vec3](../Game-Script-Environment/Userdata/Vec3.md) | The visual start position in first-person. (Defaults to position) |
| `delay` *(optional)* | integer | The number of ticks before firing. (Defaults to 0) |

### Overload 3

``` { .lua .api-signature }
sm.projectile.projectileAttack(
    uuid,
    damage,
    position,
    velocity,
    source,
    fakePosThird?,
    fakePosFirst?,
    delay?,
    acceleration?,
    lifetime?
)
```

[Open the full Game reference](../Game-Script-Environment/Static-Functions/sm.projectile.md#projectileattack-uuid-integer-vec3-vec3-player-vec3-optional-vec3-optional-integer-optional-number-optional-integer-optional)

**Parameters:**

| Name | Type | Description |
| --- | --- | --- |
| `uuid` | [Uuid](../Game-Script-Environment/Userdata/Uuid.md) | The projectile's uuid. |
| `damage` | integer | The damage the projectile will inflict. |
| `position` | [Vec3](../Game-Script-Environment/Userdata/Vec3.md) | The start position. |
| `velocity` | [Vec3](../Game-Script-Environment/Userdata/Vec3.md) | The direction and velocity. |
| `source` | [Player](../Game-Script-Environment/Userdata/Player.md) | The player that is the source of the projectile. |
| `fakePosThird` *(optional)* | [Vec3](../Game-Script-Environment/Userdata/Vec3.md) | The visual start position in third-person. (Defaults to position) |
| `fakePosFirst` *(optional)* | [Vec3](../Game-Script-Environment/Userdata/Vec3.md) | The visual start position in first-person. (Defaults to position) |
| `delay` *(optional)* | integer | The number of ticks before firing. (Defaults to 0) |
| `acceleration` *(optional)* | number | The acceleration of the projectile. (Defaults to 0) |
| `lifetime` *(optional)* | integer | The max lifetime of the projectile in ticks. (Defaults to 400) |

### Overload 4

``` { .lua .api-signature }
sm.projectile.projectileAttack(
    uuid,
    damage,
    position,
    velocity,
    source,
    fakePosThird?,
    fakePosFirst?,
    delay?,
    acceleration?,
    lifetime?
)
```

[Open the full Game reference](../Game-Script-Environment/Static-Functions/sm.projectile.md#projectileattack-uuid-integer-vec3-vec3-unit-vec3-optional-vec3-optional-integer-optional-number-optional-integer-optional)

**Parameters:**

| Name | Type | Description |
| --- | --- | --- |
| `uuid` | [Uuid](../Game-Script-Environment/Userdata/Uuid.md) | The projectile's uuid. |
| `damage` | integer | The damage the projectile will inflict. |
| `position` | [Vec3](../Game-Script-Environment/Userdata/Vec3.md) | The start position. |
| `velocity` | [Vec3](../Game-Script-Environment/Userdata/Vec3.md) | The direction and velocity. |
| `source` | [Unit](../Game-Script-Environment/Userdata/Unit.md) | The Unit that is the source of the projectile. |
| `fakePosThird` *(optional)* | [Vec3](../Game-Script-Environment/Userdata/Vec3.md) | The visual start position in third-person. (Defaults to position) |
| `fakePosFirst` *(optional)* | [Vec3](../Game-Script-Environment/Userdata/Vec3.md) | The visual start position in first-person. (Defaults to position) |
| `delay` *(optional)* | integer | The number of ticks before firing. (Defaults to 0) |
| `acceleration` *(optional)* | number | The acceleration of the projectile. (Defaults to 0) |
| `lifetime` *(optional)* | integer | The max lifetime of the projectile in ticks. (Defaults to 400) |
