# Dragonbones problem

**URL:** <https://phaser.discourse.group/t/dragonbones-problem/6758>\
**Category:** Phaser 3\
**Created:** [June 23, 2020, 4:40pm UTC](https://phaser.discourse.group/t/dragonbones-problem/6758 "2020-06-23T16:40:25Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Maddogmaycry](https://avatars.discourse-cdn.com/v4/letter/m/b9bd4f/32.png) [@Maddogmaycry](https://phaser.discourse.group/u/Maddogmaycry)\
**Post date:** [June 23, 2020, 4:40pm UTC](https://phaser.discourse.group/t/dragonbones-problem/6758/1 "2020-06-23T16:40:25Z")

</div>

Hello,

I use dragonbones in **scene from instance** mode.

> <https://github.com/photonstorm/phaser3-examples/blob/master/public/src/scenes/scene%20from%20instance.js>

When map is changed dragonbones did’nt load a armature - no errors, no character, nothing. The firstone i do, is trying to switch level like:

```
    game.scene.remove('SceneMain');
    game.scene.add('SceneMain', SceneMain);
    game.scene.start('SceneMain');

```

How do i inizialise a level

```
   var SceneMain = new Phaser.Scene('SceneMain');			
   SceneMain.preload = function(){
    this.load.dragonbone("doc",
        	"characters/doc/doc_tex.png",
        	"characters/doc/doc_tex.json",
        	"characters/doc/doc_ske.json");
     }

     SceneMain.create = function(){
         this.add.armature("doc_skin", "doc");
     }

```

When i for wxample copy a dragonbone json object, and do another name - it’s works.  
All another objects lika a pics, textures, sounds works good.

If i destroy game object

`game.destroy(true);`

and then

`game = new Phaser.Game(config);`

it’s works well, but if I initialize the game object again, sometimes I have problems with the pointer

```
SceneMain.input.on ('pointerdown', function (pointer, obj) {
 ...
}

```

For example, variable worldX and Y is 0.  
and  
camera: undefined…

I can fix this with a setTimeout after game.destroy() but then sometimes i recive new error from dragonbones…

How can i reload a dragonbones whit out reloading a game?  
Pls, help me 🙂

---

<div class="post-metadata">

**Author:** ![Maddogmaycry](https://avatars.discourse-cdn.com/v4/letter/m/b9bd4f/32.png) [@Maddogmaycry](https://phaser.discourse.group/u/Maddogmaycry)\
**Post date:** [June 24, 2020, 7:41pm UTC](https://phaser.discourse.group/t/dragonbones-problem/6758/2 "2020-06-24T19:41:30Z")

</div>

I tryed in classic mode, and it’s still not working. After scene changing, dragonbones no wanna loading arnature anymore.

```
 <script>
		let config = {
			type: Phaser.WEBGL,
			<!-- physics: { -->
			<!-- default: 'arcade', -->
			<!-- arcade: { -->
				<!-- gravity: { y: 300 }, -->
				<!-- debug: false -->
			<!-- } -->
			<!-- }, -->
			scale: {
				mode: Phaser.Scale.FIT,
				autoCenter: Phaser.Scale.CENTER_BOTH,
				width: 1920,
				height: 1080
			},
			audio: {
				disableWebAudio: true
			},
			plugins: {
				scene: [
					{ key: "DragonBones", plugin: dragonBones.phaser.plugin.DragonBonesScenePlugin, mapping: "dragonbone" }
				]
			},
		};

	var SceneA = new Phaser.Class({

    Extends: Phaser.Scene,

    initialize:

    function SceneA ()
    {
        Phaser.Scene.call(this, { key: 'sceneA' });
    },

    preload: function ()
    {
        this.load.dragonbone("doc",
	"characters/doc/doc_tex.png",
	"characters/doc/doc_tex.json",
	"characters/doc/doc_ske.json");
    },

    create: function ()
    {
        this.add.armature("doc_test", "doc");

        this.input.once('pointerdown', function () {
           this.scene.start('sceneB');

        }, this);
    }

});

var SceneB = new Phaser.Class({

    Extends: Phaser.Scene,

    initialize:

    function SceneB ()
    {
        Phaser.Scene.call(this, { key: 'sceneB' });
    },

    preload: function (){
        this.load.dragonbone("doc",
	"characters/doc/doc_tex.png",
	"characters/doc/doc_tex.json",
	"characters/doc/doc_ske.json");
    },

    create: function ()
    {
		this.add.armature("doc_test", "doc");
       		
		this.input.once('pointerdown', function (event) {
           this.scene.start('sceneA');

        }, this);
    },

    update: function (time, delta){
       
    }

});

var game = new Phaser.Game(config);
game.scene.add('SceneA', SceneA);
game.scene.add('SceneB', SceneB,true);
</script>
```
