# Defining "Sprite Pivot Point" and "Looping" for animations in games

**URL:** <https://community.aseprite.org/t/defining-sprite-pivot-point-and-looping-for-animations-in-games/2637>\
**Category:** Features\
**Created:** [February 2, 2019, 6:45am UTC](https://community.aseprite.org/t/defining-sprite-pivot-point-and-looping-for-animations-in-games/2637 "2019-02-02T06:45:49Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Salem](https://community.aseprite.org/user_avatar/community.aseprite.org/salem/32/1557_2.png) [@Salem](https://community.aseprite.org/u/Salem)\
**Post date:** [February 2, 2019, 6:45am UTC](https://community.aseprite.org/t/defining-sprite-pivot-point-and-looping-for-animations-in-games/2637/1 "2019-02-02T06:45:49Z")

</div>

Hello, everyone!

Aseprite has aided me greatly in producing assets in a timely manner, however, I’ve found two things to be missing:

- The ability to expose a “Sprite Pivot Point” for a spritesheet in the .json-file
- The ability to expose a “Loop” field for each animation in a sprite in the .json-file

**My Use Case**

I’m a programmer and an artist. I’m developing a 2D game in Unity and in my opinion, its animation tools are poorly suited for sprite-based animations, so I’ve written a custom Sprite Animator and an Unity-Editor Extension for it. With the spritesheet and .json-file created by Aseprite, the extension creates an “Animation Container” that my custom Animator references (“which sprites belong to which animation”, “duration of each frame”, etc. …) – all with the click of a single button.

**Sprite Pivot Point**

As much time as my extensions saves me, this one-click-solution is limited. I still need to work with Unity’s built-in Sprite Editor, cutting out the spritesheet and assigning a pivot point for each frame of the animation (for instance, in a sidescroller game you might define the pivot to be at the feet of a character.)

 ![Unity%20Editor%20Example](https://community.aseprite.org/uploads/default/original/2X/c/c6525f7a09654a688d27f34f16af6854ea193897.jpeg)

While Unity allows the user to cut out the sheet automatically/based on parameters, my goal is to completely skip the step of having even to deal with the editor. All I need for that is the ability to read the pivot point from a file.

![Meta%20Pivot](https://community.aseprite.org/uploads/default/original/2X/3/3d4e0840cb56da5ed4e5abbd88d8d20dc6fa9031.jpeg)

That way, I could cut out the sheet and assign the pivot just by using code. I’ve temporarily circumvented this problem by creating a new “Animation Tag” for my Sprite and storing the pivot coordinates in there.

 ![Aseprite%20Timeline%20Pivot](https://community.aseprite.org/uploads/default/original/2X/7/766dc9c0d6e0ce8a8b2dc6423f0f5f22b7f6d32b.jpeg)

While this gets the job done, it feels dirty and is far from intuitive.

**Implementation**

Maybe you could have a “Pivot Tool”, which lets you pick a pixel on your sprite (similar to the color picker). That position is stored in the .ase file and, when it comes to exporting the spritesheet, that value gets inserted into the meta-block of the .json- file (if no value is picked, it will default to {0, 0}). That’s just off the top of my head, though.

**"Loop" Field**

Animations in my game know whether they are supposed to loop (i.e. a walking-animation) or only play once and then change to another animation (i.e. an attack- animation goes into an idle-animation). For this purpose I’d like another field exposed in the .json meta-block, which allows me to parse that data.

![Meta%20Pivot%20Loop](https://community.aseprite.org/uploads/default/original/2X/8/804153272f1fe68ff81f0e41d3f2b1d3a1b98643.jpeg)

Currently, I’m solving this by prefixing looping animations with “L\_”.

**Implementation**

I’m imagining the “Animation Tag” window has a “loop”- checkbox that can be ticked.

 ![Loop%20Field](https://community.aseprite.org/uploads/default/original/2X/1/1424fd1a821dd831b31e0738b134130dde38113e.jpeg)

Thank you for reading this lengthy post! I hope I was able to make my goals clear and explain why I and others could benefit from those features. While my particular problems stem from the use of Unity (perhabs a clever solution just eludes me), I could see these points be valid in other game-making scenarios as well. Aseprite has become my go-to source for making animations and integrating them into games. I love how it packages all the relevant data in a .json file and I feel like this could be extended even more in the future.

---

<div class="post-metadata">

**Author:** ![eishiya](https://community.aseprite.org/user_avatar/community.aseprite.org/eishiya/32/902_2.png) [@eishiya](https://community.aseprite.org/u/eishiya)\
**Post date:** [February 2, 2019, 4:58pm UTC](https://community.aseprite.org/t/defining-sprite-pivot-point-and-looping-for-animations-in-games/2637/2 "2019-02-02T16:58:23Z")

</div>

I’d really like both of these features too!

I currently get around their absence by encoding the loop bool as “Loop\_” at the start of the tag name (looks like @Salem does the same with L\_ hehe), and by having a layer with my hitbox and pivot drawn and adding the pivot data in an external tool using that layer as reference.

---

<div class="post-metadata">

**Author:** ![ron1987](https://community.aseprite.org/letter_avatar/ron1987/32/6_22734026db12803ebb3e059622ac3534.png) [@ron1987](https://community.aseprite.org/u/ron1987)\
**Post date:** [March 13, 2019, 10:55pm UTC](https://community.aseprite.org/t/defining-sprite-pivot-point-and-looping-for-animations-in-games/2637/3 "2019-03-13T22:55:51Z")

</div>

I second (or it third) this! Being able to have “loop” in addition to forward, reverse and pingpong would be a huge time saver.

---

<div class="post-metadata">

**Author:** ![mpete](https://community.aseprite.org/user_avatar/community.aseprite.org/mpete/32/1386_2.png) [@mpete](https://community.aseprite.org/u/mpete)\
**Post date:** [August 12, 2019, 5:48pm UTC](https://community.aseprite.org/t/defining-sprite-pivot-point-and-looping-for-animations-in-games/2637/4 "2019-08-12T17:48:28Z")

</div>

I had the same need to store custom pivot pixels. The Aseprite importer [MetaSprite](https://github.com/WeAthFoLD/MetaSprite) lets you define a layer as a pivot layer, and pixel(s) in it define the pivot point. I’ve improved it a little to let you add any store as many layers of coordinates as you want with [MetaSpritePlus](https://github.com/marcpeterson/MetaSpritePlus).

---

<div class="post-metadata">

**Author:** ![cremmy](https://community.aseprite.org/user_avatar/community.aseprite.org/cremmy/32/24752_2.png) [@cremmy](https://community.aseprite.org/u/cremmy)\
**Post date:** [May 6, 2020, 7:19pm UTC](https://community.aseprite.org/t/defining-sprite-pivot-point-and-looping-for-animations-in-games/2637/5 "2020-05-06T19:19:26Z")

</div>

In case someone else comes to this thread - using \*.aseprite file importer seems to be the way for now. It’s fairly easy to port the importer from MetaSprite to C++ or any other language, it’s pretty well written. I went with the similar way, using group “@points” in which every layer specifies single point (sprite pivot, hand locations, etc). Just use cel’s position.

Also, in case you need it, every cel is compressed using zlib, if you want to use “uncompress” function you’ll have to include 4 byte header and footer with hash, skipped in MetaSprite.

---

<div class="post-metadata">

**Author:** ![WolvenBard](https://community.aseprite.org/user_avatar/community.aseprite.org/wolvenbard/32/21411_2.png) [@WolvenBard](https://community.aseprite.org/u/WolvenBard)\
**Post date:** [June 2, 2025, 7:25am UTC](https://community.aseprite.org/t/defining-sprite-pivot-point-and-looping-for-animations-in-games/2637/6 "2025-06-02T07:25:35Z")

</div>

Sorry to waken the dead here, but I came across this issue recently and this is one the main threads that pops up in a google search.

I’ve created a free aseprite plugin that adds a context menu option for tags to set a pivot point:

 ![image](https://community.aseprite.org/uploads/default/original/3X/a/5/a5a67e474581efae7f6e839367b824ea477fdd1a.png)

> **[Aseprite Tag Pivots by Necronomison](https://necronomison.itch.io/aseprite-tag-pivots)**
>
> A simple Aseprite plugin that lets you define pivots for frame tags.

Posting this here for posterity in case anyone else is looking for a similar solution 🙂
