• 2D
  • Texture size for animations

Hi All! I'm new to Godot and moving to it from Unity, so I'm going to ask some questions in the near future :)

Now I have a player and some animations for him. The problem is in the sprites sizes. So, for Idle, Walk animations the sprites are 64x64 and it's enough for them. But for the Strike animation the sprites are 64x80 and 88x64. So when I animate the player, its sprite "jumps", because the player is centered.

Is it possible to set up the pivot point for the sprites, not for the player? I mean when the sprite is 64x64 - the pivot is in the center. But when the sprite has another size, move the pivot a bit to the up or to the right.

If it's not possible, then is it the only way to make all the sprites of the same size? In this case the sprites 64x64 will have some gaps.

Thanks!

10 days later

Hi :). When you use for example, Sprite nodes, and add a texture to it you can click the Sprite node and go to the Offset properties in the Inspector and make your adjustments there.

@ZoeyZanidoo thanks, but what if I have sprites of different size? In this case I need to set the offset every time I play another animation.

Pretty sure you could use AnimatedSprite node then?

Yes, I'm using AnimatedSprite. And that's the idea. Some animations (and their sprites) have the same dimensions, and the other have another.

@Maklaud said: @ZoeyZanidoo thanks, but what if I have sprites of different size? In this case I need to set the offset every time I play another animation.

Sorry I'm still learning Godot and programming myself :P.

Are you centering these? If so check Centered for all of them and if 64x64 is the norm, then offset all of those by 0x0, and for the oddly shaped ones it's 0x16(64x80) and 24x0(88x64) respectively.