CoBlockly On Update


#1

I can’t locate the “On Update” block in CoBlockly, looking to recreate my code here but I need that block (unless I can run it with a forever block?)

40%20AM


#2

Hi @Outpost_31,

the best way to simulate the behaviour of the on update - block from Blockly is to place a forever - block into a run separately - block (in Loops -> Other category) like this:

run separately causes all code inside of it to be executed in a different thread, meaning that the code inside of it will be executed while the rest of the CoBlocks script after run separately runs. This was in essence what the on update Blockly block did.

In CoBlocks, you can also exit this separate forever-loop with the break out of loop - block once you want to stop running the loop.

Hope this helps!


#3

Hi. It’s not easy for beginners. So I think you should create a new block.


#4

Thanks for the help, could you give a quick example where that block would be necessary?


#5

Hi @Outpost_31,

a common use-case for the run separately - block is executing actions for all items in a lists simultaneously. Check out this tutorial about using lists for details.

@Daniel_Pers,

thanks for the feedback! We’ll look into ways to incorporate this behaviour, perhaps even as another option in the forever block itself.


#6

thanks for the example, appreciate the quick responses, it makes for a strong forum, that is growing, when we are getting detailed answers to our questions, reminds me of the Cura forum :slight_smile: