# sm.ai.getAimPosition

Returns true if the character can fire at the target harvestable within a given fire lane.

**Kind:** Function

**Environments:** Game

## Game

### Overload 1

``` { .lua .api-signature }
sm.ai.getAimPosition( self, target, range, width )
```

[Open the full Game reference](../Game-Script-Environment/Static-Functions/sm.ai.md#getaimposition-character-harvestable-number-number)

Also returns the aim position that allows the character to succeed.

**Parameters:**

| Name | Type | Description |
| --- | --- | --- |
| `self` | [Character](../Game-Script-Environment/Userdata/Character.md) | The firing character. |
| `target` | [Harvestable](../Game-Script-Environment/Userdata/Harvestable.md) | The target harvestable. |
| `range` | number | The maximum firing distance. |
| `width` | number | The width of the fire lane. |

**Returns:**

| Type | Description |
| --- | --- |
| boolean<br>[Vec3](../Game-Script-Environment/Userdata/Vec3.md) | The result. |

### Overload 2

``` { .lua .api-signature }
sm.ai.getAimPosition( self, target, range, width, attack )
```

[Open the full Game reference](../Game-Script-Environment/Static-Functions/sm.ai.md#getaimposition-character-character-number-number-integer)

Returns true if the character can fire at the target character within a given fire lane.

Also returns the aim position that allows the character to succeed.

Any obstacle shape that blocks the target, but can be destroyed by the projectile, will be targeted instead.

**Parameters:**

| Name | Type | Description |
| --- | --- | --- |
| `self` | [Character](../Game-Script-Environment/Userdata/Character.md) | The firing character. |
| `target` | [Character](../Game-Script-Environment/Userdata/Character.md) | The target character. |
| `range` | number | The maximum firing distance. |
| `width` | number | The width of the fire lane. |
| `attack` | integer | The attack level of the projectile. (Defaults to 5) |

**Returns:**

| Type | Description |
| --- | --- |
| boolean<br>[Vec3](../Game-Script-Environment/Userdata/Vec3.md) | The result. |
