• Unity
  • Spine Runtime Errors In Unity After Update

Related Discussions
...

I took a few months off working on a Unity project of mine which uses Spine animations but have recently tried to get back working on it. Since last working on it, I've gotten a new computer and have transferred everything to the new computer. At the same time


and perhaps this was a mistake


I installed the newest version of the Spine Runtime (v4.0).

I have many CS0117 and CS1061 "does not contain a definition for..." errors all pertaining to the AttachmentTools Spine Runtime script. In reading the Spine 3.7 to 3.8 & Spine 3.8 to 4.0 Upgrade Guides here on the forums, I understand I'm supposed to replace certain lines of code, but I seem to be struggling to do this. I'm not very good when it comes to coding. The previous version of the Spine Runtime I was using was 3.7.

As an example, one of the CS0117 errors is 'MeshAttachment' does not contain a definition for 'inheritDeform'. In the AttachmentTools script, the lines of code throwing the error are:

public static MeshAttachment GetClone (this MeshAttachment o) {
         var ma = new MeshAttachment(o.Name) {
            r = o.r,
            g = o.g,
            b = o.b,
            a = o.a,

        inheritDeform = o.inheritDeform,

According to the 3.7 to 3.8 upgrade guide, I am to replace MeshAttachment.GetLinkedClone() with MeshAttachment.NewLinkedMesh(). However, I don't see a "MeshAttachment.GetLinkedClone()". I only see "MeshAttachment GetClone" and "MeshAttachment(o.Name)". So I'm not really sure what I need to do to fix this error code.

At the end of the day I'm really just trying to get things working like they were on my old computer. Any help would be appreciated. Thanks.

Are you sure that you have deleted the old Spine and Spine Examples runtime directories before installing the 4.0 spine-unity runtime as stated in the upgrade guide?

If you did, it might be a problem due to the Visual Studio project not being re-generated correctly yet, then you might want to follow the description on this forum thread here, installing the latest Visual Studio Editor package in the Unity Package Manager, and then hitting Assets - Open C# Project in Unity:
Spine and Unity - using directive

the_terrible wrote

According to the 3.7 to 3.8 upgrade guide, I am to replace MeshAttachment.GetLinkedClone() with MeshAttachment.NewLinkedMesh(). However, I don't see a "MeshAttachment.GetLinkedClone()". I only see "MeshAttachment GetClone" and "MeshAttachment(o.Name)".

This sounds like you misunderstood something here. You should not modify anything of the spine-unity runtime. If you have old code written yourself that is using and older spine-unity runtime (version 3.7 or 3.8 ), then you need to adjust your code to fit the new 4.0 runtime. The upgrade guide pages also state "Adapting your code to 3.8/4.0 API changes". So your code needs changes to fit the new API. You shall not change the API to fit your old code.

I think I was confused and for some reason only deleted the "Runtime" folder within the "Spine" folder. Looking back at the update guide again I don't know why I thought this. I never imported the "Spine Examples" folder in the first place. And yes, I was also confused about modifying the API vs old script code.

I deleted the project and reinstalled it and went through the update guide steps again and it seems to be working now. Thanks for the help!

Very glad to hear, thanks for getting back to us! 🙂