2

I'm trying to upload the plugin to my project, tried all the methods, but nothing works. Returns an error

Uncaught TypeError: Cannot read properties of undefined (reading 'createSkeleton')
    at initialize.set Skeleton (<anonymous>:1:290667)
    at new initialize (<anonymous>:1:289262)
    at Game Object Factory.spine (<anonymous>:1:54310)
    at MainWindow.create (MainWindow.js?21c4:53:27)
    at SceneManager.create (phaser.js?d4ef:89720:1)
    at SceneManager.loadComplete (phaser.js?d4ef:89632:1)
    at Loader Plug in.emit (phaser.js?d4ef:1908:1)
    at Leaderplugin.loadComplete (phaser.js?d4ef:192810:1)
    at Loader Plug in.file Process Complete (phaser.js?d4ef:192776:1)
    at t.on Process Complete (<anonymous>:1:25378)

I work on a local server. Here is a code example of how I connect everything enter image description here

  • 1
    your code looks good, maybe your file path is wrong or the files have a wrong format _(or the phaser or plugin version are not correct)_. You could test this with the files (spine, atlas, ...) from the example here: https://phaser.io/examples/v3/view/spine/add-spine-object-to-group and here https://github.com/photonstorm/phaser3-examples/tree/master/public/assets/spine/3.8/demos – winner_joiner Jan 18 '22 at 14:46
  • It seems like version incompatibility between spine files and spine plugin – Anton Jan 19 '22 at 09:26
  • Could you find a solution? – winner_joiner Jan 22 '22 at 06:15

1 Answers1

0

I think it's the same problem I had. My spine JSON data were saved in an old format. You probably used DragonBones, which exports only version 3.3 spine data.

Here are the details someone remarked what's wrong with the file. You have three options: (A) change the file manually each time you export it, (B) use the python file the dude provides there, or (C) make a function to change the data structure accordingly after they are loaded and before the skeleton is added to scene. (This is the way I went.)

Coatl
  • 542
  • 3
  • 6
  • 19