I’m currently trying to get a spine.js Integration working with Playcanvas.
As there are now different versions of the engine and the playcanvas-spine.js around I was wondering, if someone can provide me some info on the current integration and ideally provide an up-to-date working public project.
Following aspects are unclear for me:
Engine Version: V2 → is this already supported? I get errors like:
Class constructor ComponentSystem cannot be invoked without ‘new’,
Cannot read properties of undefined (reading ‘worldX’)
with V2
Playcanvas-Spine.js → there are now newer versions at the github repository than in the asset-store ( 4.2 vs. 3.8), which version is now working, especially in combination with engine v.2 ?
Hey … so I tried to create a new spine 3.8 project in the editor and it works. We had a crash (with no impact) in the editor when the playcanvas-spine.3.8.js was added, but it worked during playback fine. See the project here: PlayCanvas 3D HTML5 Game Engine
Thanks @mvaligursky, your project works. One thing is quite odd:
When I create a new project and add the spine integration per asset store i sometimes get a minified version (playcanvas-spine.3.8.min.js) and sometimes a non minified version (playcanvas-spine.3.8.js). The different versions are already presented in the preview of the script file before the import (one line of the minified version vs. multiple lines for the regular one). As I had the minified version in my non working example I assume I may had gotten a non working version. I have now tried importing the scripts into exisiting and new projects and get a minified / regular version at random. But both versions seem to work now anyway. Is it possible that some kind of browser caching or else could influence which version of the library gets added?
I switched the project to the 4.2 Branch, here you should also find assets exportet in spine 4.2. as well as the manually added spine integration 4.2. which results int the “physics is undefined error”.
Please let me know, if I can provide anything else.
The issue with minified was me. I updated the store item with playcanvas-spine.3.8.js. I realized my mistake and uploaded minified version. You probably got it from store during that time.
Thanks. At least we still have a working integration.
Last questions: For spine 4.1 I probably use playcanvas-spine.4.1.js from the repo? Could you please add an info about the last working version at the playcanvas +spine tutorial and/or the playcanvas-spine repo. That could save other users some time.
Thank you very much for your time.
Yes, the repo is the most up to date, but personally I’ve tested 3.8 and 4.0 only, somebody else added 4.1, so fingers cross it works, please ping here with your findings.