2
\$\begingroup\$

When my designer sends me the spritesheets done with Texturepacker and I open them with the Sprite editor, i notice that the pivot point is in extremely weird positions. Way above the spritebox that it is attached to.

I told him to put the pivot point "Bottom center" instead "center", and the pivot moved to positions not so exagerated, but still outside the spritebox.

I thought that someone (my designer or me) had something misconfigured, but then I opened the example spritesheet that came with Texturepacker, and I noticed that the pivot point was also in weird positions

enter image description here

As you see the pivot point is under the spritebox. And as I say, this is because the pivot point is set to "Bottom center". If I set it to "Center", it goes even weirder positions.

What is going on? Is something misconfigured here?

\$\endgroup\$

1 Answer 1

2
\$\begingroup\$

This is as it should be - no bug ;-)

TexturePacker has 2 crop modes in Unity - to remove transparency around the sprites which consumes memory and GPU.

  • Trim Keep Pos - removes the transparency but keeps the pivot point in the position where it was in the original sprite
  • Trim Flush Pos - removes the transparency and sets the pivot point relative to the cropped sprite

The default is "Trim Keep Pos" since this allows you playing the animations without jitter if all frames had the same size and were aligned before the crop. In Unity's sprite editor it seems that the pivot point is off - but that's perfectly ok.

See this image:

enter image description here

The gray area is the original sprite, the black rectangle the trimmed. As you see the red pivot point is outside the rectangle - but in the center of the original sprite.

\$\endgroup\$
2
  • \$\begingroup\$ I believe pivot works ok for SpriteRenderer but not for Unity UI Image (which uses sprites), not sure if it is a Unity bug instead. \$\endgroup\$
    – arielsan
    Dec 2, 2016 at 17:54
  • \$\begingroup\$ Your are right: UI Images does not support pivot points. It also does not support polygon packing... I hope the Unity developers will add this one day. \$\endgroup\$ Dec 2, 2016 at 20:41

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .