After the discussion last night about loops (which I must admit may have involved wine)… I thought it’d be fun to create a script that did one thing… then did the next thing… and so on…
I can’t seem to get it to flow right on periodic… So I’ve put it in player and hit run, run, run…
The biggest misconception about the Periodic Run type is that it just runs continuously and automatically, when it doesn’t. It executes at the specific interval but still follows all the same runtime rules for code execution. It won’t just ignore all issues and then execute when it can.
If you want your code to run in Periodic, then you have to take into account when your code is running and when it isn’t. For example, if you set the graph to execute every second, then you would have to ensure that your code was able to execute and complete in less than a second. If you have any user interactions in your code, then your code is going to pause for some amount of time. You have to be sure that the pause will not interrupt the periodic execution of the code. I don’t think any of that is an issue with your specific code, but it’s always worth considering.
Just plugging the DateTime.Now node into an unused port is enough to make the python dialog run after each interaction, but that may not be the experience you’re looking for. You’d at least want an end condition so that the dialog doesn’t repeat indefinitely.
I tried that but it seemed to work for 2-3 runs then stop.
I tried the periodic into another python node that changed from A-F every 10 seconds but that also didn’t make the other node update enough times (even though it only needs to run through 7 iterations on the one pasted).
I’ve only ever used periodic for fun moving things before… I was actually surprised this didn’t work easily.