title: How to apply impulse after an object collide another? [Chipmunk]
body: <p>I'm working on a game (with Cocos2d 3.0 and SpriteBuilder) in which a character smash another and gain impulse. To do this I'm trying the following:</p>
  
  <pre><code>-(BOOL)ccPhysicsCollisionPreSolve:(CCPhysicsCollisionPair *)pair hero:(CCNode *)hero goal:(CCNode *)goal {
      [hero.physicsBody applyImpulse:ccp(0.0f, 9000)];
      return TRUE;
  }
  </code></pre>
  
  <p>And also:</p>
  
  <pre><code>-(void)ccPhysicsCollisionPostSolve:(CCPhysicsCollisionPair *)pair hero:(CCNode *)hero goal:(CCNode *)goal {
      [hero.physicsBody applyImpulse:ccp(0.0f, 9000)];
  }
  </code></pre>
  
  <p>But when the collision method is called, the character doesn't receive the impulse always. I also tried including the following inside "PostSolve" (<a href="https://stackoverflow.com/questions/21593519/how-to-make-a-dynamic-body-static-in-cocos2d-v3-0-with-chipmunk">How to make a dynamic body static in Cocos2d v3.0 with Chipmunk</a>):</p>
  
  <pre><code>[[_physicsNode space] addPostStepBlock:^{
          [hero.physicsBody applyImpulse:ccp(0.0f, 9000)];
      } key:hero];
  </code></pre>
  
  <p>...but I have the same result. Do you hace any advice? Thank you.</p>