5.6.0b10 Late physics collision problem

I’m getting some very weird physics collision related problems moving from 5.6.0b9 to 5.6.0b10. It seems that I’m getting late response times for oncollisionenter/oncollisionstay, to where high velocity objects register slower or sometimes don’t even register for the On events, whether there convex or not. Any thoughts? I could also post a video if that helps

This sounds like a similar regression reported in 5.5, it probably related to the PhysX upgrade we did in 5.5. However, not sure what might have affected this going from b9 to b10 in 5.6. Can you pull together a repro project? Will notice this thread to our physics QA. Thanks!

Thanks for the quick reply yant, also I have some good news, I can reproduce it pretty easily =) It seems that, for whatever reason, when ever you disable the physics GameObject and re-enable it, it will consistently pass through any given collider, I started noticing it because I’m pooling most of my physics objects. I’m attaching a unitypackage with a test scene where you can see an example, seems to work fine in 5.6.0b9, but anything higher b10/b11 seems problematic, also attached a screenshot. Hope this points out the problem.

Cheers!

2986848--222283--screen.png

2986848–222282–BulletTest.unitypackage (19.8 KB)

Amazing stuff, thanks @LaneMax .

Hey @LaneMax !

We’ve logged a bug for you and you may track its status in the Issue Tracker by following this link. The link should become active in a few hours, but hopefully sooner.

Thanks again!

Awesome! Thanks yant and CookieSalad!

Hey @LaneMax !

Appears that the problem is that CCD (continuous collision detection) setting is broken in b10 for objects that get enabled after CCD was set while they were disabled (regression). Will be fixing this ASAP, it’s a bad problem. Not sure there are any decent workarounds really, besides this one: set the collision detection mode to Discreet in the inspector and add a few lines to Start / OnEnable to patch up the CCD mode when the bullet gets enabled, like this:

    // Use this for initialization
    void Start()
    {
        rigid = this.GetComponent<Rigidbody>();

        // patch up the broken CCD on enabled objects
        // there is another bug that was fixed in a later version that didn't allow to change CCD modes when Discreet wasn't set in inspector
        // because of that, all bullets need to be set to Discreet first
        rigid.collisionDetectionMode = CollisionDetectionMode.ContinuousDynamic;
    }

Hope this helps - Anthony.

Awesome great to hear, thanks again!

Hi @LaneMax , just wanted to let you know that the fix for this issue will be available as part of 5.6f2 onwards. Thanks for the heads up!

Sweetness! Thank you so much