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

Pause a Lua 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 28 OF 35

Follow the shipped Lua 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 Lua, then gear_lua. 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 4, then click Start. When the line is highlighted, check which script and line appear in the paused frame. Choose a regular Lua source record. In this workbench the local teeth is 12 before the multiplication. Use Into when you want to follow a function call and Over when you want to stay at the caller’s level.

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 30 of 37Permalink
Go to page