currently there is an issue with CoBlocks variables used inside block events within functions. Contrary to parameters, variables in CoBlocks are global, that means that the bird you delete with the click-event is always the last bird reference you created. We’re looking into making this behaviour more clear to you while preventing this issue to come up again
Here’s a solution to your problem. Instead of creating targets & binding their click-events in one function, we split these steps in two separate functions instead. We also change the itemNamestring parameter to a SceneItem parameter.
I was expecting the variable “bird” to be local in the function. Thanks for your reply, it’s clear now that I know the variables in CoBlocks are “global” but parameters are local with the function.
Is there a way that I could delete an item when it is clicked once. Also, I don’t get how to use the function that are in the example at the top. Can someone please help me