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
sm.ai.getAimPosition( self, target, range, width )
Also returns the aim position that allows the character to succeed.
Parameters:
| Name | Type | Description |
|---|---|---|
self |
Character | The firing character. |
target |
Harvestable | The target harvestable. |
range |
number | The maximum firing distance. |
width |
number | The width of the fire lane. |
Returns:
| Type | Description |
|---|---|
| boolean Vec3 |
The result. |
Overload 2
sm.ai.getAimPosition( self, target, range, width, attack )
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 | The firing character. |
target |
Character | 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 Vec3 |
The result. |