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

Introduced in



Description:Returns the position on the surface directly below a given position or object, as well a normal vector that is perpendicular to the surface at that position. Works on all surfaces (ignores water), including above and underground structures.


Syntax:[from, ignoreObjects, ignoreTypes, minSize] call fn_vbs_underlyingSurface
  • from: PositionASL or Object - Object or position to find the surface beneath.
  • ignoreObjects: Array of Object - List of objects to ignore as surfaces (if from is an object, it is also ignored) (optional).
  • ignoreTypes: Array of String - List of object types (class names) to ignore as surfaces (optional).
  • minSize: Number - Minimum surface size, smaller objects may be ignored (optional).
Return Value:Array - First element is the position on the surface (PositionASL), the second is the surface normal at that position (Vector3D).


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:Place object on surface beneath player:
_surface = [getPosASL2 player, [player]] call fn_vbs_underlyingSurface;
_obj setPosASL2 (_surface select 0);
_obj setVectorUp (_surface select 1);

Additional Information

See also: fn vbs placeOnSurface