I followed this tutorial:
My setup is basically the same. In the video, "WeaponHitbox" child object is used - I have it like this:
During runtime, when I deactivate the Enemy object (i.e. the parent of Rifle object), and reactivate it again, the Attachment Name "rifle_hitbox" disappears, like this:
When I then try to play the melee attack animation, I get an error just when the polygon collider should appear:
Which indeed seems to refer to that missing "rifle_hitbox" Attachment Name.KeyNotFoundException: The given key was not present in the dictionary.
System.Collections.Generic.Dictionary`2[Spine.BoundingBoxAttachment,UnityEngine.PolygonCollider2D].get_Item (Spine.BoundingBoxAttachment key) (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System.Collections.Generic/Dictionary.cs:150)
BoundingBoxFollower.SetCurrent (Spine.BoundingBoxAttachment attachment) (at Assets/Extensions/Spine/spine-unity/spine-unity/BoundingBoxFollower.cs:181)
BoundingBoxFollower.LateUpdate () (at Assets/Extensions/Spine/spine-unity/spine-unity/BoundingBoxFollower.cs:172)
Is there anything I can do to alleviate this issue? Can I somehow reset the BoundingBoxFollower manually after I've reactivated the Enemy parent object?
I'm using Unity 5.2.0f Personal.
Thank you very much!