fn vbs inAngleSector (VBS2)
From Bohemia Interactive Community
| Editors, please check Policy: Scripting Command Page Syntax. |
Click on the images for descriptions
Introduced in
- Game:
- Virtual Battlespace 2
- Version:
- 1.19
Description
- Description:
- Use this function to determine if a position lies within a certain angle from another position.
Returns true if pos2 lies within the sector defined by pos1, angle and width.
Syntax
- Syntax:
- [pos1,direction,width,pos2] call fn_vbs_inAngleSector
- Parameters:
- pos1: Position - center position
- direction: Number - checked direction
- width: Number - checked angle
- pos2: Position - checked position
- Return Value:
- Boolean
Examples
- Example 1:
_inrange=[getPos player,getDir player,30,getPos tank] call fn_vbs_inAngleSector
will return true if the vehicle named tank is within 30 degrees of where the player is pointing.
Additional Information
- Multiplayer:
- Behaviour unknown.

