How to debug Puzzles: Difference between revisions
| Line 4: | Line 4: | ||
If you execute Puzzles incorrectly, e.g. by passing invalid inputs, they will fail to work and print the explanation in the browser console (see [https://www.soft8soft.com/docs/manual/en/introduction/FAQ.html#browser_console here] on how to open one). | If you execute Puzzles incorrectly, e.g. by passing invalid inputs, they will fail to work and print the explanation in the browser console (see [https://www.soft8soft.com/docs/manual/en/introduction/FAQ.html#browser_console here] on how to open one). | ||
Check out the following example that explain the idea. Consider you need to replace texture on some of your models with the [https://www.soft8soft.com/docs/manual/en/puzzles/Materials.html#replace_texture replace texture] puzzle, but nothing happens once you execute this puzzle. By looking in the browser console you'll find the cause of this issue immediately: | |||
[[File:invalid_texture.webp|1000px]] | |||
Yes, you've specified invalid path to the texture! | |||
== Use print to console puzzle == | == Use print to console puzzle == | ||
Revision as of 14:22, 21 March 2026
This short how-to explains how to find and fix bugs in your Puzzles scenarios.
Look for errors in the browser console
If you execute Puzzles incorrectly, e.g. by passing invalid inputs, they will fail to work and print the explanation in the browser console (see here on how to open one).
Check out the following example that explain the idea. Consider you need to replace texture on some of your models with the replace texture puzzle, but nothing happens once you execute this puzzle. By looking in the browser console you'll find the cause of this issue immediately:
Yes, you've specified invalid path to the texture!
Use print to console puzzle
Your scenario behaves odd, but there is no errors in the browser console? Just insert the print to console puzzle in the places you need to check with some meaningful data passed as input.
Summary
Ability to find bugs in Puzzles and resolve them quickly is the first skill you should master. Let's repeat the algorithm:
- open the browser console and look for errors
- insert print to console and carefully read its output