Is loading another texture more preferable than having every frame in one (AnimationPlayer)

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

Hi,

I am playing around with AnimationPlayer to create basic movement/attack animations for my character (Changing the texture and frame property of a Sprite child). I was wondering if I should split my spritesheet into multiple png files (one for movement, one for attack, etc) or should I just use one for each character ?

I guess having one big spritesheet occupies more RAM and switching the texture all the time affects the cpu performance, am I right ?

Which of these two options is more preferable ?

Thanks!

:bust_in_silhouette: Reply From: qweide

I’d recommend using one big sprite sheet for each character and just change the displayed region during the animation. This will give you better performance. Also there are no disadvantages over using multiple images that come to my mind.

However, in that case I would use an AnimatedSprite instead of AnimationPlayer, this should server your purpose better.