Can I offset a sprite for a specific animation only?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Luke Fenstad

In the game I’m currently making, I have 2 different sized sprites for the same character. Is there any way I can offset one of the animations without affecting the other ones so that they line up?

:bust_in_silhouette: Reply From: Zylann

How are you animating? AnimationPlayer or AnimatedSprite?

If the problem is that you have an animation you want to re-use with more than one sprite, there are a few solutions I can think of:

  • Make your textures the same size anyways, at the cost of having blank areas occupying memory and being drawn

  • Introduce an extra “pivot” node in the hierarchy that is not touched by the animation, so you can offset the pivot in specific situations without having to change the animated parts

  • Similar to previous, if you use a Sprite2D, change the offset property (if your animation is not using it) to achieve a similar effect