Skip to reading
New Features Workbook: 35 Hands-on Lessons

Pause a GDScript function on a line

Edition 0.86.4.7

37-page workbook using example workbenches included with the Studio release. The separately attached PDF is byte-identical to this ZIP copy and is included once.

Download PDFView illustrations

Debug, measure and deliver

STUDIO 0.86.4.6 • LESSON 30 OF 35

Follow the shipped GDScript example to see the inputs before the function returns 60.

1. Start the example from Studio

Open examples/workbenches/Clock-and-Debugging.pca3d. In Output & Diagnostics, choose Debug & Profile → Line debugger. Select GDScript, then gear_native. Set the function to run and enter [] for arguments. Leave Play game clear for this first run.

2. Set a breakpoint and inspect the frame

Click the gutter beside executable line 3, then click Start. When the line is highlighted, check which script and line appear in the paused frame. Choose the native GDScript record. When it pauses, inspect the frame and its locals before using Over. Use Out when you want to return from a nested function to the caller.

3. Finish and repeat

Click Continue to finish. For a desktop game-triggered check, use Play game before Start and trigger the action from the running game. Lua and GDScript line debugging require a desktop Godot 4.7.2 executable available to Studio. In a packaged editor, set it under Build Tools.

A real Lua pause in the workbench. The source gutter and step controls occupy the same places for the other languages.

WHAT TO CHECK

Run the matching example in Regression tests and verify that the expected return is 60. If a breakpoint never fires, check that you selected the exact language, script ID and entry function and that the line has executable code.

Page 32 of 37Permalink
Go to page