Is there a better way to switch sprites in a cutout animation than animating visibility?

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

I’m working on animations for a 2d game and was wondering if there is a better way to switch sprites for the body parts of things than toggling the visibility of the sprites in question. For example, lets say I wanted to switch between a sprite depicting a characters open hand and a sprite depicting a characters closed hand; right now I’m just attaching both sprites to the end of the characters arm and toggling the visibility based on which sprite I want to show. This can become a little cumbersome if I’m doing it with a lot of sprites/body parts because I have to create visibility tracks for everything and I was just wondering if I’m doing it wrong, or if there’s an easier way. Thx!

:bust_in_silhouette: Reply From: Zylann

You can keyframe the frame property, if your hand frames are in a strip with rectangles of same size.

You can also keyframe the texture property directly, and for each keyframe, decide which texture should be set (you can assign an AtlasTexture if you have an atlas).

Oh that makes sense. Thx a lot!

Socrates | 2018-03-01 18:50