3.8版本2D物理碰撞有时候触发,有时候不触发怎么回事?

this.collider = this.getComponent(Collider2D);
this.collider.on(Contact2DType.BEGIN_CONTACT, this.onBeginContact, this);
this.collider.on(Contact2DType.END_CONTACT, this.onEndContact, this);

回调函数有时触发,有时又不行了

image

使用这个就有机率不发生碰撞回调,用内置2D物理系统就没问题

1赞

我也有这个问题