Game stop when sprite animation change

Hello friends,

I am creating a space shooter base on the GDevelop wiki documentation (8. Powerups - GDevelop documentation) Now I am doing about powerups. The problem is about a powerup shield object. When player collect powerup shield object, everything seems ok. But when 5 seconds pass, the game supposed to have player change animation to idle. Instead, the game just stop or freeze, it wouldn’t continue to play. Here is the code.

I tried to figure out the events. I tried to remove some events to go back to the previous situation before the problem happen. When I removed "set animation of Player to “PlayerIdle” , the problem is gone. The game can continue to play. Is there anyone ever face this problem whereby changing animation cause the game to crash? Or what should I do to change animation without crashing the game?

Thank you.

Have you tried changing the animation by animation number and not by name? Instead of not changing anything, we would have to see if there are other events that are related.

Thank you. Yes I did try the animation number instead of it’s name but the problem still unsolved. The game still stops.

These are all the events.

I’m having exactly the same issue changing the animation by number! I’ve tried using both the actual number (1,2 etc.) and an object variable. The game freezes with both, but runs normally if I delete the change animation function.

I’m going to watch the topic hoping someone can help us out! :pray:

I’ve found a workaround where I don’t use animation#0, but start instead from #1 (which is a duplicate of #0) and move them all up a number. Not massively satisfying but it gets around the issue for me. Let me know if it works for you jibgencode!

@AaronMantang Wow!! Thank you so much. I tried as you suggested and it worked for me! :smile: :smile: You’ve just saved my day! Thanks again.

1 Like