[Fixed] Automatic Collision mask on old sprites makes the game freeze

So I just stumbled upon a bug that is probably update-specific. Here’s how it went.

  1. I have a “Menu” sprite object with a few animations. I never bothered changing the default collision mask because it was unnecessary. The sprite had 10 animations.
  2. I add animation 11. Same size and all. Don’t even look at the collission mask.
  3. When the game needs to switch the sprite’s animation from 11 to something else, it just freezes. Completely. I checked it with several different sprites and adding a new animation seemed to cause it. Making the sprite switch to any of the previous 10 animations worked like a charm. Making it switch to animation 11 worked too. But upon trying to switch it from animation 11 to something else, the game froze.
  4. When checking the collision mask of the “menu” sprite object, I see some of them have defined collision masks now (as in, X and Y coordinates for 4 points exist) while others say the object uses the default collision mask. Before the update, each animation used the default collision mask. Now, when switching between different animations, some showed coordinates for the 4 points while others said the default mask was used.
  5. Ticking the “use same collision mask on all animations” button and thus letting them all have a defined collision mask solved the issue.

So, in conclusion. Adding a new animation to an object that previously had a default collision mask freezes the game when switching from that new animation to one of the previously added ones.

1 Like


I had this experience too, but I tried to reproduce and I couldn’t! Glad you figured out the bug!
I believe that now it will be easier for the Gdevelop team to fix it!

Also, with your instructions and using my old game (not a new project) I could reproduce the issue exactly how you discribed.

Great job!

Hi @Rusher_go ! Thanks for reporting this.

We’ve noticed a strange behavior with collision masks and have just fixed it (will be live in the next release).
I am not able to reproduce this issue, so I assume this is fixed.
But to ensure we’re talking about the same problem, could you share with us your project so we can test it with your configuration?
You could zip it and send it via hello@gdevelop.io

Thanks again for taking the time to report this.

Hello there. So I just sent an email with the archive. It’s titled “Bug Report - Automatic Collision mask on old sprites makes the game freeze (Project)”. And it has the instructions on how to make the game freeze. If this doesn’t work, try adding a new animation to that Menu sprite yourself and doing a similar thing. And if it still works fine then, the issue is probably fixed.