Spread Value ID for Enemies. Object scoping doesn't work when destroying...

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.
  • Hi guys,

    I've tried avoiding posting on here as long as I can, as there are plenty of strong tutorials on here about spread values, object scoping etc. But I'm finally at a complete loss on my game. I feel I've made it more complicated than it should be as well.

    If anyone could shed light on what's happening here, I'd really appreciate. I'll try to explain:

    So I have a single enemy that I'd like to use multiple times in a level. I've spread the value of it and its corresponding sensors.
    It seems to work here, "Always:- set position of Enemy Sprite to Enemy Collision Box " has each instance applied properly.
    Their health seems to work properly too, I'll run around and damage enemies at random and their health reduces properly.

    The problem is when I try to destroy one. No matter how I scope it, it either destroys none, or all instances of the object that are to the left of the one I'm trying to destroy.
    Has anyone had a similar problem?

    I'm happy to explain more, I'm sure I haven't explained everything necessary to solve the problem.

    Cheers
    Zeb

  • It's hard to say without looking at your code, but my guess is that you destroy and start a loop in the same event, in which case you need to split it into two events.

    Yeah, I thought this could have been the issue, but it still doesnt scope properly. I might have to send you something to look at if you have time.

    Although word of warning, some of the code is a bit of a mess from so much trial and error.

Participate now!

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