Using collision with lists


I’m having trouble using collision with list items. Is my code wrong or is it a limitation of CoBlocks? The disabled code in this scene works but it would be much more efficient to use a list.



Hi @MBridges,

You were getting close to the solution! In order to set events on multiple items at once, you want to iterate through the list with the for each - block, and use a function with parameter to make sure that an event-handler is created for every checkpoint in the list.

Below you can find a remixable space with working code. Feel free to check it out to see how the CoBlock was adjusted to make it all work :slight_smile:

1 Like

Thank you, Stefan! I knew there was a way!