Setting the animation of a sprite doesn't work if it has 'custom size' enabled?

I was calling the event for changing the animation (I tried both by name and number) and it only worked once I unchecked the ‘custom size?’ box. (was set to twice the sprites original size).

The first animation (#0) is undefined.

Unfortunately, I can’t reproduce this. I created a new project using the Platformer example, resized the player sprite, and all of the animations still work:

image

It is a weird thing to happen. Trying to reproduce it I found that changing the animation actually seems to work, but the size is all wrong (the sprite becomes way to big).

To reproduce:

  1. create a new object. leave the first animation empty (#0) and give the second one an image.

  2. create an event that sets the animation of the object to #1 (I am calling it by name instead of number)

give the object any custom size and run the game. you will either see nothing or a very zoomed in part of the sprite.

If the first animation of the sprite (#0) isn’t empty it works as expected.

1 Like