Skip collision detection at high speed

onBeginContact(selfCollider: Collider2D, otherCollider: Collider2D, contact: IPhysics2DContact | null) {
        this.scheduleOnce(() => (otherCollider.node.active = false))
    }

Same problem in this topic problem on collision detection when node have speed

Cocos Version 3.4.0
Editor
8f5e859
Engine
b11686b
Native
28b6bc7
Native(External)
a52c327
Engine extensions
a52c327
Editor extensions
d9530a8
Runtime
d9530a8

I can ask engineering if they have thoughts.


The triggering of the physical system is related to the setting of these parameters. If the speed is too fast, you can optimize it by adjusting fixedTimeStep and maxSubSteps, checking bullet.
image

2 Likes

another problem is that the speed increases every time the node is reactivated.
it related problem onBeginContact: Error while set active property on node

ok, I think the problem is solved.

onLoad () {
        this.rigidBody2D = this.getComponent(RigidBody2D);
    }

    onEnable() {
        this.rigidBody2D.linearVelocity = Vec2.ZERO
    }