Collision detection using Character Controller

Not exactly from any course but just an issue i was facing, trying to fix it from hours but it is not working please help

the thing is i am using character controller on my player and i want to detect collisions but OnCollisionEnter() doesnt work well with character controller and OnControllerColliderHit() gets called every frame if the player is colliding with something and doesent work like the OnCollisionEnter() any solution guys please?

private void OnControllerColliderHit(ControllerColliderHit hit) { if (hit.gameObject.tag == "Hazard") { health.TakeDamage(10); } }

Hi Saiyam,

Thank you for your question. Unfortunately, we cannot help you with this problem. Please feel free to ask our helpful community of students for advice over on our Discord chat server. :slight_smile:

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.