0

For my project, I've created a running character. Currently, I am attempting to implement different animations for the character.

I've decided to create 2 different actions

1) CCAction *walkAction;

2) CCAction *jumpAction;

When the character is supposed to jump, I call a method that [self stopAllActions]; and then make it [self runAction:jumpAction]; When the character lands, I call stopAllActions and then run the walkAction.

For some reason, though, the application freezes up. I need help regarding stopping and running actions without the application crashing!

Thank you!

X Slash
  • 4,133
  • 4
  • 27
  • 35
Sushi Ninja
  • 1
  • 1
  • 1
  • 2
    I'm afraid you will have to give us some code. What is self? Have you tried stopping actions explicitly? By this I mean tagging the action and calling stopActionByTag. – Krystian Feb 07 '12 at 21:29
  • I got it figured out. Self used to be a CCLayer. Instead I used a sprite to fire the action and stop the actions. It works fine now. Thanks! – Sushi Ninja Feb 08 '12 at 18:50

1 Answers1

0

Don't try to retain actions (what I always read).

Just fire a new one each time. Cocos2d will clean it up.

Shaunti Fondrisi
  • 1,081
  • 10
  • 13