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 all views attached to the given entity.

Returns a success/failure Boolean status, and an error message on failure.


Syntax:[entityID] call Gateway_ViewClearGroup
  • entityID : Number - The ID of the entity whose views are removed.
Return Value:Array - An array with the following values:
  • Boolean - true if the entity views were successfully removed, false otherwise.
  • String - An error message, if the entity views were 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 are successfully removed from internal array.
cleared = [ objToId player ] call Gateway_ViewClearGroup;

Additional Information

See also: Gateway ViewAttachGroup, Gateway ViewGet, Gateway ViewModify, Gateway ViewRemove, 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).