I have a spine animation as part of my UI, however, I can't get it to obey the rect transform properly for other screen resolutions. Thanks in advance!
How to make Spine follow Rect Transform in Unity?
What do you mean by not "properly" obeying the rect transform? Could you please share a screenshot or describe in more detail?
By the way, this post was tagged with the Tutorial tag, but since the question is about Unity, I changed it to the Unity tag.
I assume that you mean that the SkeletonGraphic object is not automatically scaled along with the size of a parent RectTransform
. We are sorry that we didn't get to this issue ticket yet, it's on our roadmap here:
EsotericSoftware/spine-runtimes1640
We will see that we can implement it soon since it has been delayed for such a long time already.
This feature has just been implemented and pushed to the 4.1 and 4.2-beta branches. From the changelog:
SkeletonGraphic
now supports automatic scaling based on itsRectTransform
bounds. Automatic scaling can be enabled by setting the addedLayout Scale Mode
Inspector property to eitherWidth Controls Height
,Height Controls Width
,FitInParent
orEnvelopeParent
. It is set toNone
by default to keep previous behaviour and avoid breaking existing projects. To modify the reference layout bounds, hit the additionalEdit Layout Bounds
toggle button to switch into edit mode, adjust the bounds or hitMatch RectTransform with Mesh
, and hit the button again when done adjusting. The skeleton will now be scaled accordingly to fit the reference layout bounds to the object'sRectTransform
.
New 4.1 and 4.2-beta unitypackages are available for download here as usual:
https://esotericsoftware.com/spine-unity-download
@MVP New features are added to the recent runtime versions. New features are not backported to old versions such as 4.0, which is already several years old. Backporting added features might break existing projects.
Why are you using versions older than 4.1 if you seem to be starting a new project now?