The spine plugin for Phaser gives an error

792 views Asked by At

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

There are 1 answers

0
Coatl On

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.)