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); } }