Page tree
Skip to end of metadata
Go to start of metadata




Introduced in

Version:2.08

Description

Description:Calculates a ground position from a given position and (view) direction, and returns the nearest object to that position. Obstructions from buildings and walls are not considered by this function.

Syntax

Syntax:[pos, dir, ignore, range, type] call fn_vbs_getLockTarget
Parameters:
  • pos: PositionASL - Position of camera.
  • dir: Vector3D - Direction the camera points in.
  • ignore: Object - Object that should be ignored (optional, default: player vehicle).
  • range: Number - Maximum range (in meters) to search around the calculated ground position (optional, default: 30).
  • type: Array of String - Class types to exclusively use in object search (optional, default: "AllVehicles").
Return Value:PositionASL or Object - If no object is found within the specified filter criteria, the ground position the camera points at is returned. If a qualified object is found, then it is returned instead.

Warning

When using functions in VBS versions older than 3.4, certain limitations and requirements should be kept in mind - the main ones being that capitalization of the function name is crucial, and that #include "\vbs2\headers\function_library.hpp" has to be included in every script that utilizes it. More Functions A-Z.

Examples

Examples:
_target = [getPosASL player,[0,1,-.05]] call fn_vbs_getLockTarget

Additional Information

See also: 
Multiplayer: 
Problems: 

Notes