"Set Counter" sometimes does not work

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.
  • This one has been bugging me for a while now. I am not sure if it's my event logic that doesn't add up or if it's a hiccup in Fusion.

    My game has some asteroids that upon destruction will display how much score you got from destroying them. I got it to work most of the time but very often the number will display 0 instead of the number I specified in the event editor. It's almost like it skips that action randomly.

    I am attaching a small mfa with the issue. Simply hold down the left mouse button and destroy as many asteroids as you can until red zeros start showing up instead of the number 999(over here it barely takes 5 seconds to reproduce).

    Can anyone spot what I am doing wrong?

  • Thanks for the clear example :) What's happening here is a bug in Fusion that means that sometimes, when multiple objects are created from the same event and then have actions performed on them in the same event loop, only the first-created of those objects will get the actions applied to it - so if two blocks are shot at the same time, there's a chance that only one of the counters will get updated.

    To get around this, you could use the "Pick one of [asteroid]" condition in your events to detect the collision between the laser and the asteroid - this will ensure only one asteroid is destroyed per frame. At the pace of this game, it doesn't seem to have an adverse effect on gameplay, but restructuring to this could help if you find this results in skipping asteroids that should have been destroyed:

    Laser collides with asteroid > Set asteroid value 'Destroyed' to 1, make invisible
    Asteroid value 'Destroyed' = 1 + Pick one of Asteroid > genuinely destroy it and create the score counter.

    Please login to see this link.
    Please login to see this link.

  • Thanks for the fast reply!

    From your explanation I figured that the key is that the event should only happen to one object at a time to avoid the issue from happening. So switching from "Laser Overlapping Asteroid" to "Laser collides with Asteroid" solved this particular case! I've only tried for a few minutes but so far I haven't been able to reproduce the problem.

    But I can see that having a "Destroyed" state makes more sense in order to make sure they're always checked.

    Thanks!

    Please login to see this link. Please login to see this link.
    Freelance Dev | Currently Working on Jarvis | Please login to see this link.

Participate now!

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