We have found that if you have nested or embedded input procedures the third input procedure will not read its input value.
However, if you take the HTML page itself and run that in a separate window without the puzzle viewer…the procedure is picking up the input variable and working correctly.
This is a Viewport issue only. Considering I had been developing in the viewport frequently, I just ran into this. So for now the solution is to just have a window of the HTML page up and the App Manager up and use those to and not use the Viewport.
This error is not always repeatable. However to get the most repeatable results you have to use Chrome.
Steps to cause issue:
1. Close Chrome
2. Re-open Chrome
3. clear browsing data
4. open the App Manager
5. open the project with viewport on
6. turn on dev console
7. run the project
8. a three layer or more embedded procedure will fail.
9. Reload the scene by refreshing the browser
10. It will work some most of the time..but can loose the variable about 10% of the time.
The initial load using steps 1-7 each time will cause the embedded procedures to loose their values and be undefined 100% of the time.
So there is an error in the Viewer or the Viewer is running out of memory…not sure.
We are currently updating Puzzles for the latest Blockly and are releasing the 5th preview soon (1-2 weeks). There is a possibility this update will fix many issues so I encourage you to test it out and see if it helps.