Returns a position that is the specified distance and compass direction from the given position / object.
If an offset is specified, the final destination is also the offset, at a 90-degree angle. If the value is positive, the offset angle is 90 degrees; for a negative value, it is 270 degrees (V1.23+).
|Syntax:||[point, distance, direction, offset] call fn_vbs_relPos|
|Return Value:||Position-2 - Relative position from |
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 Category VBS Scripting Functions.
// Finds a position 5m away from the player along azimuth 100
_pos = [player, 5, 100] call fn_vbs_relPos
// Starts at the position from the previous example, then moves 10m along azimuth 190, and returns this point
_pos = [player, 5, 100, 10] call fn_vbs_relPos
|See also:||fn vbs rotatePoint, fn vbs relativeModelPos|