Hi guys,

I have a set of Spine exports which I am using in Unity with their UI system with SkeletonGraphic components, which for the most part work well.

The issue I am having is that the UI anchors don't seem to alter Spine elements in a similar fashion to built in Unity UI elements. An example of this is that if I have a 16:9 full screen object and I want this object to be anchored to 100% of the screen, when I switch to another resolution, say 18:9, the graphics do not resize to fit the screen size and will have a portion off the screen.

Is there a way I can get SkeletonGraphic components to respect the settings of the RectTransform anchors for the object they are attached to? Positional anchoring works without issue in respect to the RectTransform but all scaling is ignored.




An example can be seen here.

On the left is a Spine SkeletonGraphic anchored within the screen boundary, on the right is a Unity UI Image, anchored to a similar portion of the screen.

At 16:9 the top of the Spine object is within the screen and the image on the right is within the screen as can be seen below:


At 18:9 the top of the Spine object has left the top of the screen while the Unity UI Image on the right has maintained its position and scale to fall within the screen as can be seen below:


This functionality is essential to handling multiple devices (e.g. phones at 18:9 against tablets at 4:3 for example). If anyone has any input on how I could achieve the same effect with Spine objects I would appreciate it.

You do not have the required permissions to view the files attached to this post.
  • Posts: 1


You are correct. The skeleton's scale is unaffected by the RectTransform of the GameObject. Mostly because a skeleton doesn't actually have a fixed scale, unlike sprites. This is the same behavior you'd run into if you were to put a multi-GameObject character using Unity's own system, or other skeletal animation systems.

In the current implementation, we make no assumptions as to how the skeleton scale relates or behaves relative to the RectTransform's dimensions.

An additional component/script could probably be written to do this scaling. The script can have a base RectTransform size, watch the dimensions, then calculate and apply the appropriate scale for the skeleton. It would need to keep the RectTransform pivot in mind to align it properly with the pivot of the skeleton as it scales.
User avatar
  • Posts: 5366

Return to Unity