I need help with ForEach Loops for Boss Battle!

Welcome to our brand new Clickteam Community Hub! We hope you will enjoy using the new features, which we will be further expanding in the coming months.

A few features including Passport are unavailable initially whilst we monitor stability of the new platform, we hope to bring these online very soon. Small issues will crop up following the import from our old system, including some message formatting, translation accuracy and other things.

Thank you for your patience whilst we've worked on this and we look forward to more exciting community developments soon!

Clickteam.
  • Hey Clickteam!

    I'm making a boss battle where the boss has these shields that revolve around the boss. The idea is the player will have to destroy these shields before they can attack the boss.

    After a while, the shields will regenerate. Here's my issues:


    1. When I click on a shield to destroy it, a random shield gets destroyed, not the one I click on. I believe I'm not scoping properly and want to learn how and why!

    2. When new shields get created, I only want to create them where the old ones were destroyed. Right now, when the Create Shield Group gets activated, it creates over the ones that were not destroyed

    as well as the ones that were destroyed.


    I'm attaching a quick, simple replica of what I built if that helps! Thanks Clickteam!

    Please login to see this attachment.

  • Fredetmumu!!! Thank you! It destroys the ones I click on! Much more simpler code. Thanks!

    Now, the only other head scratcher I have is how to create only new satellites that were destroyed. Right now, when it loops, it creates new satellites over all whether destroyed or not.

  • If you scope for each after clicking on it, you get the opposite of what you want. Also, if you already create the objects by an ID to get them at their correct positions in the cirlce, you can just print their ID to a pool (list object) when destroying them, and then pull from that list object which position needs to be recreated and delete it in the list (thus making it a pool) when you want to respawn them.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!