Skip to main content

Source Editor

Source Editor is Studio's text editor for scripts, shaders, data files and any other text file. It also shows the text behind the visual editors, so a change made in Scene View or the Effect Editor appears here too, with the same Undo history. Saving, conflicts, autosave and recovery are described in Documents.

Layout​

  • Tabs: one per open document. A dot marks unsaved changes; read-only files are marked · Engine or · External. When tabs overflow, scroll them with the mouse wheel or the arrow button.
  • Header: the file path, Ln, Col and Saved, Unsaved or Read only.
  • Text area: line numbers, text and a scrollbar.

Press Ctrl+Tab to switch between recent documents: keep Ctrl held, press Tab to move down the list, and release Ctrl to switch. Esc cancels.

Editing​

Click in the text to start typing.

KeyAction
Arrows, Home / End, PgUp / PgDnMove the cursor.
Ctrl+Left / Ctrl+RightMove by word.
Ctrl+Home / Ctrl+EndGo to the start / end of the file.
Shift + movementSelect.
Shift+Alt + movementSelect a rectangle (column selection).
TabInserts four spaces.
Backspace / DeleteDelete a character or the selection.
Ctrl+Backspace / Ctrl+DeleteDelete a word.
EscClears the selection, then leaves the editor.
MouseAction
Click, drag, Shift+clickPlace the cursor, select, extend the selection.
Double-clickSelect a word (keep dragging to select more words).
Alt+click, Alt+dragRectangle selection. Typing, pasting and deleting apply to every row.
Click a line number (.bt files)Toggle a breakpoint.
Right-clickCode menu: Inspect Symbol, Complete, Go to Definition, Find Usages; see Code intelligence.

Undo (Ctrl+Z), Redo (Ctrl+Y), Cut, Copy, Paste, Select All, Save (Ctrl+S) and Toggle Breakpoint (F9) are Studio commands; see Commands and shortcuts.

Find​

KeyAction
Ctrl+FOpens Find. Selected text becomes the search.
TypeSearches as you type.
Enter / Shift+Enter, F3 / Shift+F3Next / previous match. F3 works with Find closed.
EscCloses Find.

Search is case-sensitive, matches literal text on one line, and wraps around the file. The box shows N of M or "No results".

Highlighting​

FilesHighlighting
.btBT
.glsl, .vert, .frag, .comp, .geom, .tesc, .tese, .shader, .vs, .fs, .vsh, .fshGLSL
.hlsl, .hlsliHLSL
.wgslWGSL
.metalMetal
.json, .ctprojectJSON
.yaml, .yml, .motion, .rigYAML

Shader files show a Shader Editor header with the language. Saving a shader only saves the file; rebuild the game to see the change.

Read-only files​

Engine library and dependency sources (· Engine) and files outside your project opened from the debugger or code navigation (· External) are read-only. You can select, copy and search them.

Limits​

  • Not implemented: find and replace; regex, whole-word or case-insensitive search; auto-indent; indenting a selection (Tab replaces it); triple-click; word wrap; IME input.