• Unity
  • Drag and Drop SkeletonData -> Parent

Harald, when I drag SkeletonData in the project view on a specific object, the new object is not instantiated under the object I dragged it onto. In other words I expect the new object get nested under the object I dropped it on. This is especially handy when you drag that object on a Canvas. At this moment you instantiate the object outside the canvas which causing issues with scaling when we manually drag it afterward under the Canvas object.

Thanks, Marek.

Related Discussions
...
  • Изменено

This unfortunately happens when you have the Canvas as last (bottom-most) element in the Hierarchy panel, and didn't have the Canvas selected when dragging the SkeletonData asset onto the Canvas object. Drag and drop works without any issues on any other object in the hierarchy except for the last element of the hierarchy. Unfortuantely Unity's Editor API does not return the target GameObject as drop target here for some reason. As a solution for now, please either not have the Canvas as last element or select the parent with the mouse before dragging onto it.

I will have a look whether this issue can be fixed in current Unity versions.


Actually it was the other way around, Unity's Editor API returns the last target GameObject as drop target even when over empty space past the last element, which was why we added functionality to then instantiate after the last element instead of parented to the last element. This would then lead to the observed behaviour when selecting the last element as parent, it then also placed the element after the last element.

This issue has just been fixed on the 4.0 and 4.1-beta branches for Unity 2021.2 and newer versions (which provides an additional better callback method). New unitypackages are available for download:
Spine Unity Download

Issue ticket for later reference:
https://github.com/EsotericSoftware/spine-runtimes/issues/2077

Thank you.


Harald, tested the new functionality and regretfully have to say that it is messing with the other things drag and drop in Hierarchy. Now we can not a drag thing, not related to spine, just ordinary objects!!! I'm latest 2021.3.2f1 We also can not reorder skeletons in hierarchy, parent things etc. A bit mess :-)


Any update on this?

Sorry, thanks for reporting!! Fixed on both 4.0 and 4.1-beta branches.