Help with bug change scene and physics

Hello, any project hangs when changing scenes more than five times if there physical objects.

Upload an example

Game Folder … oyecto.rar

Proyect Folder … oyecto.rar

Click on the button to change the scenes

Thank you!

It’s a known bug that seems not to be caused by GDevelop itself but by the physic library used by GDevelop.

Thanks, It has no solution?

The problem seems to be in physicsruntimebehavior.js

In version 3 of gdev it works correctly but the file has changes, is called physicsruntimeautomatism.js


the error seems to be along these lines

[size=150]physicsruntimebehavior.js gdev 4:[/size]

#76 /**
#77 * Get the shared data for a scene.
#78 *
#79 * @method getSharedData
#80 * @static
#81 */
#82 gdjs.PhysicsSharedData.getSharedData = function(runtimeScene, name) {
#83 if (!runtimeScene.physicsSharedData) { //Create the shared data if necessary.
#84 var initialData = runtimeScene.getInitialSharedDataForBehavior(name);
#85 runtimeScene.physicsSharedData = new
#86 gdjs.PhysicsSharedData(runtimeScene, initialData);
#87 }
#89 return runtimeScene.physicsSharedData;
#90 };

#139 this._sharedData = gdjs.PhysicsSharedData.getSharedData(runtimeScene,;

physicsruntimeautomatism.js gdev3

#125 //Create the shared data if necessary.
#126 if ( !gdjs.PhysicsRuntimeAutomatism.scenesSharedData.containsKey#125(runtimeScene.getName()) ) {
#127 var initialData = runtimeScene.getInitialSharedDataForAutomatism(;
#128 var data = new gdjs.PhysicsSharedData(runtimeScene, initialData);
#129 gdjs.PhysicsRuntimeAutomatism.scenesSharedData.put(runtimeScene.getName(), data);
#130 }
#131 this._sharedData = gdjs.PhysicsRuntimeAutomatism.scenesSharedData.get(runtimeScene.getName());

#141 gdjs.PhysicsRuntimeAutomatism.scenesSharedData = new Hashtable();

I already solved for those who have the same problem, you must remove the word “throw” in 1 line and of column 15 of box2d.js

Not if it is the right way, but it works perfectly without any problems.

Would be good in gdev updates make this change because they are not going to be able to play with physical as it hangs after several changes of scenes.

Thank you for your help