[BUG] [Workaround Solution] Collision not being detected in certain cases. Cocos Creator 1.4

Is there any known issue with cc.Collider Cocos Creator at v1.4.0? I’m facing an issue where diff node hierarchy sequence affects whether the collision is detected or not. Try it yourself when you swap the sequence of player and enemy node in the editor node tree.

mystery.zip (510.7 KB)

1 Like

UPDATE

So I chased the rabbit and found the cause of the problem. The group manager in the 1.4 editor is making errors at setting the collision matrix config. There’s a simple workaround this by setting the collision matrix yourself. The config is placed at ‘ProjectPath/settings/project.json’.

For example to get this config working:

The setting set by the editor:

"collision-matrix": [
    [
      false,
      false,
      false
    ],
    [
      false,
      false,
      true
    ],
    [
      false,
      false,
      false
    ]
],

"group-list": [
    "default",
    "view",
    "enemy"
],

The setting you should set:

"collision-matrix": [
    [
      false,
      false,
      false
    ],
    [
      false,
      false,
      true
    ],
    [
      false,
      true,
      false
    ]
],

"group-list": [
    "default",
    "view",
    "enemy"
],

Restart your project and I have save your day! You’re welcome :stuck_out_tongue:

PS: You can ignore the message ‘Important: Group cannot be deleted!’ since you can remove the group in the config.

2 Likes

Just found this bug too, will fixed soon. : )

1 Like