Monday, November 7, 2022
HomeGame DevelopmentCollider animated not contact with Collider static - Cocos Creator

Collider animated not contact with Collider static – Cocos Creator


I create CircleCollider2d with rigidbody2d (kind animated) and put in a node. After I rotate this node, it doesn’t contact callback with a node BoxCollider2D + rigidbody2d (kind static).

Contact Callback perform

onLoad() {
    this.Wheel.getChildByName("arrow")
      .getComponent(BoxCollider2D)
      .on(
        Contact2DType.BEGIN_CONTACT,
        () => {
          console.log("hit----------");
          eventTarget.emit(CS_EVENTS.PlaySound, SOUND.TICK);
        },
        this
      );
  }

Console.log doesn’t seem


White Dot:

Arrow:

Each of them handed one another with out contact callback:
ezgif-3-2929158424

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments