[3.24.1] Spine: Infinity x, y, width and height problem

Hi Everyone!

I hope someone out there can help debug a problem I’m currently having using Spine in 3.24.1 (Using plugins/spine/dist/SpinePlugin.min.js)

It seems to be installed fine, and the spine objects load in the Scene without errors, but they don’t display. Their displayOriginX, displayOriginY, width and height values are Infinity or -Infinity

Screenshot 2020-12-21 at 12.47.17

I’m aware that spine object need to be exported with Spine 3.8 or higher, which these assets are (3.8.99). I’m having this problem both with my spine assets and assets from the Phaser example files which I’m loading into my game.That means I’m probably doing something wrong on my side… but I don’t know what.

If anyone out there has seen this before and some idea where I should look, please let me know :grinning_face_with_smiling_eyes:

Still seems a version mismatch.
I’ve tried this version with 3.24.1, works for me.

@Milton That worked, thanks so much!! I would never have been able to figure that our without your help!!! So it seems that the version of the Spine plugin that comes with 3.14.1 is actually the incorrect one(?).

I’m getting a different (better?) error now: “Slot not found: name”. This might be because:

Any insights helpful! And, I’ll continue to debug… :slight_smile:

I think you need pre 3.8.

@Milton Thanks, we’ve just tried with Spine 3.7.94. Everything now loads fine with no errors, but the spine object doesn’t display on screen. All its values (x, y, width, height etc) seem normal, but displayOriginX and displayOriginY seems strangely different.

… Will keep debugging… I’m sure I’ll get it sooner or later! :slight_smile:

Just a little update. Our new animations are breaking when we try and re-export them using 3.7.94, but I was actually able to open and view a 3.7.94 test animation by modifying the spineboy code from the Phaser examples. (No luck yet though getting it to display in our actual game - see post above.)

That’s promising, but even if we do manage to get 3.7.94 to work we’re trying to avoid down-versioning our existing Spine animations as doing that will be quite time consuming. So, I’m back at trying to get the 3.8.95 runtime working again. I took a look at the the examples in Phaser 3.34.1, but noticed they don’t actually seem to work?

Running the spine-boy 3.8.95 locally also generates this error:

So I’m wondering - can anyone confirm that Spine animations exported with Spine 3.8.95 actually work in Phaser 3.24.1?

I’m pretty sure the answer is no. It seems these days Discord is the better chance of getting an answer…

@Milton Thanks, I will dig around on Discord

Hey Everyone, I was able to fix this problem!

It turns out the animations I was loading were using named skins, none of which were named “default”. So, immediately after loading the animation, I set the skin name explicitly, like this: spineAnimation.setSkinByName("nameOfSkin"); That was it! My spine animations now all work just fine using Spine 3.8.99 and Phaser 3.50.1 :grinning_face_with_smiling_eyes:

I stand corrected!!!

Even though setting the skin caused the animation to display, I’m still seeing -Infinity and NaN values on displayOriginX and displayOriginY . I thought it might still be OK, until I noticed if I tried to create physics body from the spine object, the body’s x and y values NaN and the body won’t display.

Back to the drawing board on this one!

… I figured it out!

Spine animations that have skins, MUST have a skin called “default”. If they don’t they’ll get these errors.

Is this a Phaser “bug”…?

Further update, just for reference. In chatting with my animator, it doesn’t look like the Spine application lets you specifically name an skin as “default”. So, as far I can tell, this would have to be done by manually updating the exported JSON.