Instances and Overlapping

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.
  • How do I fix the multiple instance problem with a situation like this:

    Always
    >Set alpha blending coefficient of layer to 'Value A' of "Detector"

    When "Player" overlaps "Detector"
    > Add to 'Value A' of Detector

    When "Player" is not overlapping "Detector"
    > Subtract from 'Value A' of Detector

    So when the player overlaps one of these detectors, the aflpha blending coeffeicient does not change correctly, because the player isn't overlapping EVERY instance of the detector. How do I work around this? I've tries "For each loop" and that's does work. Thanks for any input.

    YouTube: Please login to see this link.
    Twitter: Please login to see this link. or Please login to see this link.

  • Foreach loop should do it, but if that's not working for you for some reason you could try something like this

    Always
    > Set Detector Flag 0 to OFF

    When "Player" overlaps "Detector"
    > Set "Detector" Flag 0 to ON

    When "Detector" Flag 0 is ON
    > Add to 'Value A' of Detector

    When "Detector" Flag 0 is OFF
    > Subtract from 'Value A' of Detector


    This should make it so every detector is turned off by default every tick of the frame, but then turned back on if it is overlapping. As long as the overlap condition happens after the flag off condition, it should work

  • I *guess* - I may be wrong - that it's a question of scoping.

    When you write:

    When "Player" overlaps "Detector"
    > Add to 'Value A' of Detector

    The scope is on the "Player" and not on the "Detector". Hence, the command "add to Value A of Detector" does not address a particular Detector, as you may ( logically ) think.

    You may try with this, instead:

    When "Detector" overlaps "Player"
    > Add to 'Value A' of Detector

    Now the scope should be on that single Detector, and the change of Value A should apply only to that single instance of Detector.

    Anyway, the solution suggested by Please login to see this link. is a good one.

    I hope it makes sense and that helps,
    Sergio

  • Thanks guys. I tried both examples, neither of them worked though. In the end I just used the player object to add/subtract a value from, as there is only one isntance of that (Still had instance issues that way, but resolved eventually...) I wanted to use the detector though so I could understand scoping better. I read through a user guide but it's such a confusing topic and I don't think I'll ever understand it.

    YouTube: Please login to see this link.
    Twitter: Please login to see this link. or Please login to see this link.

Participate now!

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