Bug with object groups and variables


Hi, There is an error/crash that happens whenever I modify a global variable from scene 1 and then delete an object from a group in scene 2 while using the global variable.


TypeError: Cannot read properties of null (reading 'getDrawableX')
    at s.putAroundObject (file:///tmp/GDTMP-1000/preview/runtimeobject.js:1:17841)
    at Object.gdjs.GameCode.eventsList15 (file:///tmp/GDTMP-1000/preview/code0.js:814:53)
    at Object.gdjs.GameCode.eventsList21 (file:///tmp/GDTMP-1000/preview/code0.js:1103:98)
    at c.gdjs.GameCode.func [as _eventsFunction] (file:///tmp/GDTMP-1000/preview/code0.js:1174:15)
    at c.renderAndStep (file:///tmp/GDTMP-1000/preview/runtimescene.js:1:5067)
    at a.step (file:///tmp/GDTMP-1000/preview/scenestack.js:1:409)
    at file:///tmp/GDTMP-1000/preview/runtimegame.js:1:7879
    at i (file:///tmp/GDTMP-1000/preview/pixi-renderers/runtimegame-pixi-renderer.js:1:9624)


Game Link: gd.games game build

How to reproduce:

  1. Preview the game and set the time to 91 (it shouldn’t be 91, but that bug works only with some number (I guess) and one of them is 91)
  2. Set the players to 2
    Like this:

Other details

  • GDevelop desktop
  • Version of GDevelop is: 5.3.180 (editor full version: 5.3.180-8dbf9c99ce5a0fe0417c0cb09302abcbc974d172, core version: 4.0.99-0-release)

Hi, can you try something out? Are you using the default collision mask in any of the objects used to cause the bug? Can you try enabling the manual one instead?

I’m using a custom collision box:
I have 3 players in scene 2, and all of them use a custom collision box, the collision boxes are not exactly the same but I have tried to make them about exact.
This photo shows the collision box for player 3 (about the same collision box applies to the other players):

There is only one frame in each player, no animations, or other frames in any animations.

I’m already using the manual collision boxes, so I tried enabling the default one instead, and it worked,
but why did this issue relate to collision boxes? Why, if the time is set to such a specific value, why the collisions not work? Also, I still want to use custom collisions, the defaults are too big.

I don’t have any problem sharing you the code of the game, but I don’t know how or if you actually need it.

Because of this line:

I suppose “drawable” is the collision mask, and “null” is because for some reason it can’t read the collision mask values, so I told to use a manual collision mask because it worked on this post:

But seems like for some reason your issue has been fixed by using the automatic one, so, it can relate to your events when the time is set-up at that specific value.

so should i wait for an update to be released?

Most likely, because if you don’t use either the “while” event, javascript (or any extension that uses javascript) at any of your events, and the game crashes, then something is wrong.

1 Like