Physics.ignoreCollision and Animations: Not playing nicely together

Hi,

So, here’s the problem. I have a gameObject with a couple of colliders attached that is set to ignore collision with a set of other gameObjects (with their own colliders).

The collision ignore is necessary because the objects are attached together with joints, and while they remain connected, they must not collide with each other. (This is also why they can’t use layer-based collision ignores)

The system I have to set up the ignore flags is working pretty well here, save on one situation: If the colliders are parented to an animated transform, the moment the animation is played, the ignore flags seem to get bypassed completely. Also, resetting the collision ignore flags doesn’t seem to have any effect from there on.

I’m tempted to call this a bug with the collision ignore flags system, but I’d like to try and find a solution.

Has anyone experienced anything like this? I know it’s not exactly a common issue to come across… but here’s hoping.

Thanks in advance for any insight.

Cheers

Well, I solved the issue here.

I remembered that animations run after Update and before LateUpdate, so I set my script up to continuously refresh the ignore flags on LateUpdate, and that did the trick.

Apparently, if a collider is moved by animation, even if it’s only parented to an animated object, it will lose its collision ignore flags after each animation update.

Something to keep in mind for later.

Cheers