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

Introduced in



Description:IMPORTANT: This function only works when VBS is started with the -gateway switch.

Removes the specified views, so they cannot be retrieved by Gateway ViewGet. Returns a success/failure Boolean status, and an error message on failure.

Note: Returns true even when the view was already removed.


Syntax:viewIDs call Gateway_ViewRemove
  • viewIDs: Array - The IDs of the views to remove.
Return Value:Array - An array with the following values:
  • Boolean - true if the view was successfully removed, false otherwise.
  • String - An error message, if the view was not successfully removed.


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.


// Returns [true] if Views 1 & 2 are successfully removed from internal array.
removed = [ 1, 2 ] call Gateway_ViewRemove;

Additional Information

See also: Gateway ViewAttachGroup, Gateway ViewGet, Gateway ViewModify, Gateway ViewClearGroup, Gateway ViewSetSensor, IG UpdateCamera
Multiplayer: The function returns nil, if not used in multiplayer or when Gateway is not active (the -gateway start-up parameter is not used).


Known issue:
The view is still attached on IG.