- Created by Umut Uyurkulak, last modified on Dec 06, 2019
The Console is a command-line editor, allowing access to many advanced functions within the Sandbox Editor, including various debug and test modes.
It is located in the top-left corner of the UI by default, in a tab next to the Create Object tool:
It can also be opened by going to Tools → Advanced → Console.
When in Game Mode (Ctrl+G), the Console can be opened by pressing the tilde key (~ on most keyboards, typically located in the top-left corner of your keyboard):
The Console window in the Sandbox Editor is used to input Console Commands and Console Variables (CVars). It is treated as any other tool, and is therefore able to be docked anywhere in the User Interface.
The Menu can be accessed via the icon on the top-right corner of this tool. When clicked, it reveals the following sub-menus:
Exports a Console log file to a specified folder.
Clears the Console output window.
Opens a Search bar to search in the Console output window.
Finds the previous occurrence of your search.
Finds the next occurrence of your search.
|Opens the toolbar customization window allowing users to customize existing toolbars, and/or create new toolbars within this tool.|
|When disabled, the positions of toolbars and spacers within this tool can be changed by drag and drop.|
The following options allow users to use spacers in positioning their toolbars.
The Spacers menu options are only available when Toolbars → Lock Toolbars is disabled.
Lists all default and custom toolbars (if any) created for this tool, allowing users to select which toolbar they'd like to hide or display.
When a tool has a toolbar, whether this is a default one or a custom one, the options above are also available when right-clicking in the toolbar area (only when a toolbar is already displayed).
|Go to documentation...||Opens the documentation page for this tool.|
Opens a list of Console commands.
Opens a list of CVars.
Command Line & Output Window
In the bottom of the Console you'll find the command line where you can enter Console Commands and Console Variables (CVars).
For example, a console variable that is used rather often is r_DisplayInfo, to which different integral numbers can be assigned. A value of '1' for example means that some basic profiling information like the current Frames Per Second are shown at the top-right corner of the Viewport. A value of '0' disables the display of that information, while the value '2' will use another display mode with slightly different information.
Using the Console
Using the Console is very straightforward: you enter a command or CVar in the command line, hit Enter and it will be executed.
The Console has its own search function built in, so you don't necessarily have to open the Console Commands and Console Variables screens mentioned above.
You can simply start typing part of a Console Command or CVar into the command line and you will see a list of color-coded search results in the Search Results window:
You can then scroll through this list of search results by scrolling with the mouse wheel or with the Up and Down arrows. Hitting Enter or clicking the Console Command or CVar of your choice will select it and display it in the command line. All you then need to do is enter a value and hit Enter again to execute it.
For more advanced information please see the Console and Config Usage document.
Console Commands & CVar Search Windows
In the Sandbox Editor, there are also separate windows to search for Console Commands that also give a description of what they do. This is especially useful for less advanced users.
For a full list of Console Commands, you can go to Help -> Console Commands. The following window will open:
This is a fairly basic Search window for all existing Console Commands in the Sandbox Editor.
In the Search bar in the top, you can type anything you want to look for, and any command with the text you typed in its name will be displayed in the Search Results window below.
Search Results Window
In this window, results of searches you have entered in the Search Bar will be displayed. For example, searching for "position" will result in several commands including the text "position":
In the Description column, a description of the command will be displayed.
For a full list of Console Variables, you can go to Help -> Console Variables. The following window will open:
This is a similar search window to the Console Commands window, but this one is specifically designed for Console Variables.
In the Search bar in the top, you can type anything you want to look for, and any CVar with the text you typed in its name will be displayed in the Search Results window below.
Search Results Window
In this window, results of searches you have entered in the Search Bar will be displayed. For example, searching for the often-used "displayinfo" will result in a couple of CVars including the text "displayinfo":
There are 4 columns in this Search Results window:
Shows the name of the Console Variable.
Shows the value the CVar has in your level at the time of the search.
Double-clicking on this value will let you change it right away without having to go back to the Console itself. Hit Enter to confirm the change and the change will be implemented.
Gives a description of what the CVar does, including all possible values.
Shows the type of the CVar.
Importing and Exporting CVars
There are also two buttons for importing and Exporting CVars in case you want to save them as a *.json file.