World's first VSCode Debugger Extension to debug Lua scripts on the O3DE Game Engine.
TL;DR
Install this extension. Obviously!
Run the O3DE Editor.exe, and open a level that references a Lua file of interest. For the sake of this example, let's assume the file you need to debug is located at C:\GIT\Pacman3000\Scripts\ghost.lua.
In VSCode open the file mentioned above. Set a breakpoint, let's say inside the OnActivate() function.
On the top right corner of the VSCode window, hit the Debug File button:
Because the O3DE Editor.exe is already running, it will automatically connect to this debugger, and in turn this debugger will show the following banner in the bottom-right location of the status bar: O3DELuaDbg: Editor.exe(Attached):
This banner not only informs us that the O3DE Editor is connected to this debugger, but also that this debugger is attached to the Script Debug Context running in the O3DE Editor.
Now, go back to the O3DE Editor and enter Game Mode (Ctrl+G).
Immediately, you should see VSCode window getting the focus again highlighing the line where the breakpoint hit.
From now on, debug away! Step Over (F10), Step Into (F11), etc ...