First off, hello!
For the basics, I am using a Character Controller for my player-character and various colliders with rigidbodies for obstacles. My character’s OnControllerColliderHit() function is called when it bumps into one of these obstacles in any direction, except for obstacles straight above it. The character’s motion is clipped correctly, and the CollisionFlags returned from Move() show that it has detected a collision from above, but it still does not call OnControllerColliderHit(). Any help with this?
Hello and welcome to the forum, Dange!
Is there anything different about the colliders above the player compared to the others? The ones above are mesh colliders while the others are primitives, say? Also, is there a rigidbody component either on the character or on the obstacles?
The colliders are all primitives at the moment, and everything has a rigidbody. The rigidbody on my character is kinematic. The obstacles are also stationary. I’ve found that if the obstacle falls on my character, I can handle events through OnCollisionEnter(), but if the controller is the only moving one, I can’t get any trigger.
In my simplest test I have my flying character and a single obstacle. If I land on the obstacle or touch it with the sides of my character capsule, my event triggers. However, I can fly under that same obstacle and touch it with the top of my capsule, and OnControllerColliderHit() doesn’t get called anymore.
I’ve done a quick test, and it seems that OnControllerColliderHit doesn’t actually get called when the collision happens from above. I’ve filed a report on this, but there’s no obvious workaround other than checking the CollisionFlags returned by Move or SimpleMove, which I know is not ideal. 