Cospaces when item clicked block

so I figured out that if you but a if something is clicked then this you can only do it for one object

You can definitely use “when clicked” for more than one item. Just make sure that you use the “run parallel” block and then put each “when clicked” in each of the run parallel sections. You can add more “run parallel” sections by clicking the gear.

Hi @vmikow,

in fact placing “when clicked” blocks inside different sections of “run parallel” in this case has no reasons behind it, except if you want to overcomplicate a program. For example in this space you can click a girl to make her rotate and while she is rotating you still can click a boy, although “run parallel” is not used at all.

This happens because “when clicked” block itself is executed instantaneously, regardless of how many actions happen on click and how much time they consume. Additionally, these actions are executed in parallel with the rest of your program by default, even without “run parallel” block.

Have you had different experience with “when clicked” blocks?

1 Like

When I started using CoSpaces a few years ago, that was the method that was shown on the CoSpace tutorials and so I always used it. Now that I’ve learned a couple different ways to get items to move, go to scene, etc without run parallel. For instance you can add a tab and run each section of your space simultaneously. If you are making a parkour course, you could put different obstacles in different tabs. Now that I know a bit more javascript and can more easily use variables, sometimes I go that route. If I’m teaching a very basic class, I still just put things in “run parallel” because it works in the scene and kids understand it quickly.

Thanks for clarification, @vmikow.

Also, there are some examples of using “when clicked” and “run parallel” blocks in the most recent CoBlocks Reference Guide in the “Multiple actions at once” (multiple simultaneous actions in response to a single click, “run parallel” is necessary) and “Keeping score” (different actions in response to clicks on different items, “run parallel” is redundant) sections.

Hope this helps!