cocos-engine
cocos-engine copied to clipboard
Physicial contact 2D always call back parameter "contact" of zero-vector normal.
Cocos Creator version
3.6.2
System information
Windows 10 Editor
Issue description
I have 2 rigid bodys which are not sensors with Box2D engine, but when contact calling back, the contact param is always zero-vector normal, the configs, codes and logs are as list:



Relevant error log output
{ "colliderA": null, "colliderB": null, "disabled": false, "disabledOnce": false, "_impulse": null, "_inverted": false, "_b2contact": null }
{ "points": [], "separations": [], "normal": { "x": 0, "y": 0 } }
Steps to reproduce
onBeginContact(selfCollider: Collider2D, otherCollider: Collider2D, contact: IPhysics2DContact | null) { if (otherCollider.tag === COLLIDER_TAG.BASKET) { let contactWordInfo: IPhysics2DWorldManifold = contact?.getWorldManifold(); console.log("get score", contact, contactWordInfo, contactWordInfo.normal); this.node.dispatchEvent(new ScoreIncreaseEvent(true, {increase: 1})); this.scheduleOnce(() => { this.node.destroy(); }); } }
Minimal reproduction project
No response
@LightingX could you please provide a demo? Thanks.
JJ. Liu已收到来自您的邮件,请耐心等待处理,谢谢。