Collider/Trigger event problem in Windows/Android Build

Issue: Collider and Trigger event callbacks are not functioning as expected on Windows and Android builds. The logic appears to be working correctly on web builds and in the Cocos C editor.

Gameplay Description: At the start, the character (Pink Capsule) falling towards the ground. Upon contact with the Yellow box, a Trigger event is triggered by the script. When it makes contact with the green ground, a Collider event is triggered by the script.

I’m attaching some files below to provide a more detailed understanding of the problem -

  1. ‘A’ is a screenshot of the Physics Group settings. I am using the PhysX based physics system:
  2. ‘B’ is a screenshot of the Inspector view of a Character capsule. This capsule comprises the Capsule character controller responsible for movement, Capsule Collider for Collider/Trigger Events, and a Rigidbody component.
  3. ‘C’ is a screenshot is from Script which is handling player movement, Collider/Trigger events and some visual Representation of UI.
  4. ‘D’ is a screenshot of gameplay within the editor, where everything is functioning as expected.
  5. ‘E’ is a screenshot of gameplay within the Windows Build, where callback events have not been triggered, and the UI has not been updated as expected.

Questions :-

  1. Why is this issue occurring only in Windows and Android Builds while the Web and Editor versions work as expectation?
  2. Are there any potential solutions within the Editor settings that could resolve this?
  3. Is it necessary to modify the logic, script, or Inspector configuration to achieve the desired outcome?

Thank you community in advance :smile:

What version of Cocos Creator are you using?

Cocos Creator 3.8.0

In my testing, they worked normally on both Android and Windows. I submitted my testing project.

59615.zip (8.4 MB)

As previously mentioned:

  1. I am currently using the PhysX-based physics system. The screenshot of your console indicates the use of Bullet physics, which is not ideally suited for the CapsuleCharController (as per the documentation).
  2. The gameplay functions as expected in Web Builds and the Editor, but it encounters an above mentioned issues in the Windows and Android Builds.


The above screenshot is from the Editor’s Browser Playmode.

.
Here is the link to access the my Scene Package : https://drive.google.com/file/d/1ZlWNehV0zZHA95DuJSC0eJuV3V_Vwvu3/view?usp=sharing
Note:
Please do add Physics Group for Player in editor settings (As same as main Thread screenshot) & Set it to Rigidbody & CapsuleCharController components to prevent Self Collision (As same as main Thread screenshot).

I opened your scene and changed the Player Controller’s RigidBody Type to DYNAMIC, which solved the problem. Using KINEMATIC would cause the issue you mentioned.

We will follow up on this issue and submit a fix for the code.

Unfortunately, I haven’t been able to resolve the problem with the dynamic Rigidbody. I’ve attached screenshots below, one from the Cocos Simulator and the other from the Windows build, to visualize the issue.

.
.
Your assistance in investigating this issue is greatly appreciated. Thank you very much. I’ll be closely following the discussion on GitHub Thread and eagerly anticipating any updates or solutions that may arise.

59615.zip (663.6 KB)

Please take a look at my project and try running it on the simulator.