audio.play() - 17dTesting Error with clearing buffer from source: Invalid Operation

Thank you Brent. You’re right. preCollision is required. I’ll try to move sound, fx functions to postCollision event. I will post the results.

added

There’s problem. If e.contact.isEnabled set to false, postCollision doesn’t fired. [import]uid: 161695 topic_id: 35524 reply_id: 141794[/import]

Hi @songinnight,
Is the post-collision event needed for some reason? I was thinking this:

  1. pre-collision handles the physics contact
  2. normal collision handles the sounds/effects

Brent

[import]uid: 200026 topic_id: 35524 reply_id: 141803[/import]

Hi, Brent.

The reason why is to check box2D calculation has solved or not and to recover initial velocity of ball.

I sent you an e-mail with full game source code and resources so you can run in simulator.

I’m sorry to bother you.
and thank you. [import]uid: 161695 topic_id: 35524 reply_id: 141952[/import]

Hi @songinnight,
I didn’t get the email, can you resend?

For checking the collision after resolving, can you just detect the “ended” phase of the regular collision filter, then run a short timer (10-20 milliseconds) and perform your action then? This will let you check the Box2D body properties in the next game cycle, thus, after the collision resolves.

Brent [import]uid: 200026 topic_id: 35524 reply_id: 142337[/import]

Hi, Brent.
I made a mistake. I have sent to “donotreply@coronalabs.com”… : (
Could you tell me your email address? then I will send you the file you can run.
My email address is songinnight@big4games.com

* Normal collision ignores preCollision - contact.enabled false… [import]uid: 161695 topic_id: 35524 reply_id: 142448[/import]