Detecting overlap of different geometric shapes without RigidBody2D

Hello,
I am working on a bullet-hell game and am having problems with bullet collision detection. Essentially, it comes down to either inaccurate detection or unwanted behaviors.
Here are the methods I have tried:

  1. Adding Collider2D to the bullets and the player; adding RigidBody2D to only the player with “Bullet” checked; adding a contact listener with the following code:
this.node.getComponent(Collider2D).on(Contact2DType.BEGIN_CONTACT, (self: Collider2D, other: Collider2D, contact: IPhysics2DContact | null) => {
    console.log(other.node.name);
})

This method resulted in inaccurate collision detection (i.e., it prints the bullet node’s name when no bullet seems to overlap with the player)

  1. Building on Method 1, I added RigidBody2D, with “Bullet” checked, to all relevant nodes. This does give accurate results, but the bullets collide (an unwanted behavior) rather than overlap. In addition, it also introduced chaos into other nodes (due to the collisions), such as lasers.
  2. Building on Method 2, I changed the collision layer of the bullets’ RigidBody2D, but of course, this produced no collision callbacks.
  3. I have also read some forum posts, but found no answer.
  4. I have also considered using getBoundingBox(), but due to the varied shapes of sprites, this method is not sensible.

Hence, how can I tackle this problem?
P.S. I am relatively new to Cocos Creator.

So… I have made some progress. I changed RigidBody2D.Type to Kinematic and “Allow Sleep” to false, and now the bullets are overlapping and registering collisions correctly. However, may I ask whether or not this will impact performance significantly? (And why)


2D Rigidbody | Cocos Creator, you can see the link above for more details.

If you want to make rigidbody moves by setting velocity, you should set the rigidbody to Kinematic or Animated Type.

Here are the links for how to use contact callback, and how to enable the draw debugging information,

  1. 2D Contact Callback | Cocos Creator
  2. 2D Physics Manager | Cocos Creator