Inconsistent Physics Collision Check

Collision Check works most of the time for me but it also doesn’t sometimes?

i think GDevelop can play another sound only if the current sound has stopped playing

I can do it with another action and have the same effect. Maybe I should move this to bugs?

I’m wondering if it has to do with the physics update, in that the position of the ball is occasionally updated a couple of times before the events script is executed.

What happens if you tick the Bullet box in the balls’ Physics behaviour tab? I think that’s designed for faster moving objects, but is a bit more processor hungry. If that still doesn’t fix it, then put it in the Bug Reports channel.

Few things I would check first:

  1. Make sure you have “preload as sound” checked in your resources panel for the wav file.
  2. Add a trigger once to the conditions. You’re very likely flooding the buffer because the ball is in collision more than once per frame.
  3. Use the “play sound on a channel” event rather than “play a sound”. It gives slightly more control to you (as the dev) in the future, but also means you can just use the “play the sound of the channel” event if needed, rather than replaying the sound file each time.

Tried it but it didn’t change it.

What did you try? There are a number of suggestions given.

I did both yours and Silver’s suggestions. Here’s the project file if you want to look, if you knock the ball around for a few minutes you’re going to notice it not registering a few times.

I downloaded the project and ran it for 5 minutes. It occasionally didn’t work, but it was very, very sporadic.

However, I found the very first bounce/collision is not registering. Every single time. I tested by changing the background colour at as well as making a sound, and that confirmed it was the first bounce that doesn’t register, and it’s not an issue with playing the sound.

I suggest you create a minimal project that recreates this issue (the physics 2 objects colliding not registering every time) and submit it as a bug.

Im not getting the same effect with the first bounce not registering. I made a project where it recreates the same collisions, and the check inconsistency is completely random for me.

also there is a problem when an object collide with a static object and the linear velocity of x or y is under 100 the the object looses it’s velocity.