Endless CharacterController Problems (and OnCollisionEnter)

Hi everyone,

I’ve been searching the forum and I found contradictory information about the CharacterController and OnCollisionEnter.

What I need:

I want a floor object which should break if the player jumps to hard onto it.

So, I have my player character with a rigid body and a character controller attached to it.
I have my floor object with a rigid body, a collision box and a script to detect OnCollisionEnter() attached to it.

When I let fall a box onto my floor object (box with rigid body and collision box), OnCollisionEnter get’s called.

When I jump with my player character onto the floor object, OnCollisionEnter is not called.

So… how can I solve my problem? I need the collision force to determine if the floor object should break or not…

Thanks for helping me

i think that the problem is being made by ussing character controller rigidbody in the same object.

It dont use to work. I have tried it a lot of times. I only can tell you that your method is correct but you only can use one of this 2 features.

A character controller has its own collision event: OnControllerColliderHit

Yes… but that doesn’t give me the force of the collision as does OnColliderEnter. I only can detect that I touch something but not the force which is generated by this. So that function does not help me.

That charactercollider solves quite some problems; but it also has some really stupid limitations.

If anyone could either tell me how to use oncolliderenter or calculate the collision force using the travel distance…

OnControllerColliderHit is called from Move, which YOU call, so you know what velocity caused the hit. From that and the normal of the hit, you know the force.

Thanks for the suggestion… I now have breaking glass with added forces dependent on the broken piece distance to the hit point.