How do I fix my sprite animation :(

To preface

I’m making a game for kids where they have to complete a word by controlling the basket that has the first syllable of the word and catching the falling second syllable.

So based on events rn is when shape1 collides with the basket, the basket will turn into an empty one, and a particle “Kopi” appears. Then I wanted the basket to turn back into the first animation BUT the baskets stay empty :smiling_face_with_tear:

This is my current event

These are the animations
sorry it might look confusing as the baskets are named Monsters I tried following a tutorial on YouTube but didn’t work)

I hopee someone give me a hand, Thankss <3

Hello, Mobii

I think it’s because you are changing the animation back to “monsterIdle” using a subevent. And because when Shape1 collides with Monster you are deleting it, this main event will not be true anymore and your subevent will not be read by Gdevelop when the animation MonsterHurt finished. Try to change this subevent and make it a main event.

Hi @Rasterisko !

I tried it but it’s the same problem sadly. It wont change back into the first state :frowning:

Hi @Mobii

Whenever you use repeat for a group of objects, GDevelop will pick the group itself as the object, not the objects that are added to the group. In this case, “Shapes” is picked and “Shape1” & “Shape2” are not. All the conditions & actions should be for “Shapes”.

Does it make sense?

eg. instead of: The number of “Shape1” currently picked =/ 0

replace it with:

  • The number of “Shapes” currently picked =/ 0
  • Compare two strings: Shapes.ObjectName() = “Shape1”

Hello @insein I think I get it. I’m trying to implement what you said but I’m stuck here. Did I pick the wrong command?

I hope the The number of “Shapes” currently picked =/ 0 is correct!

Just remove the quotations (" ") from Shapes.ObjectName()

Also make sure to replace all “Shape1” & “Shape2” with “Shapes” in the actions. I circled them in the screenshot that I sent before.

Do I have to do the same to Shape2?

bcoz I only want Shape1 to change the baskets animation. So if Shape2 collides with the basket. the basket stays the same.

This is what I got so far.

It’s always important to show all the code related to the events. In the first screenshot of your events, it’s not possible to see that your events were children of a “Repeat for each instance event”.

I don’t know if it will be enough to fix your problem, but I still think it’s necessary for you to change your sub-event (that changes the animation) and make it a main event for the reason I explained in the previous comment.

1 Like