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

This command / function has no effect and / or is disabled in VBS4.

Introduced in



Description:Returns the information about the underlying surface of a given position.


Syntax:underlyingSurface position
  • position: PositionASL - The ASL2 position to examine.
    Tip: To detect any terrain surface faster, a negative Z-coordinate can be used in the position.
    Care should be taken when using the Z-coordinate of the examined object. While it is possible to use the Z-coordinate of the object returned by getPosASL2, the results can be unexpected. This is because the object coordinates are not the same as the object center of gravity. The coordinate values, including the Z-coordinate, are set by the object (model) creator.
Return Value:Array - Detected surface data:
  • surfaceHeight: Number - ASL2 height of the nearest surface below the given position.
  • surfaceType: String - Surface type. Can be: "TERRAIN", "ROAD", "WATER", "ROADWAY", "OBJECT", "SNOW" (default: "OBJECT").
  • surfaceNormal: Vector3D - A vector defining the surfaceNormal for the detected surface.
  • surfaceObject: Object - The object the surface belongs to.
  • surfaceMaterial: Array - An array describing the material of the detected surface:
    • impact: String - An attribute of the surface information .bisurf  file, defined in the .rvmat .
    • soundEnviron: String - An attribute of the surface information .bisurf  file defined in the .rvmat .
    • surfaceType: String - The surface type of a given terrain segment, if valid.
    • roadType: String - The type of the detected road segment.


_surfaceInfo = underlyingSurface (getPosASL2 player)

Additional Information

See also:surfaceType, surfaceNormal