Collision Normals from Character Controller

I have a scenario where my character controller is in a corner colliding with a ground plane and a wall plane. Theoretically, the collider should return multiple collision normals - one from the ground and one from the wall. It seems that OnControllerColliderHit returns only one collision normal, granting priority to the ground plane.

Is this true, or is there a way to obtain all collision normals detected from the character controller?

Hi, welcome to the forum!

Is the character walking into a wall while standing on the floor and yet OnControllerColliderHit doesn’t get called for the wall? If the character really does hit two other colliders simultaneously, then there may not be any way around this. However, OnControllerColliderHit should get called on the first frame of each collision.

You may be able to use a raycast to get the normal of the colliding surface under some conditions. Is there any chance you could give a bit more detail about what is going on in your game?

Thanks for the welcome Andeeee!

Yes, the character is walking into a wall while standing (basically pushing a wall or block). The collision flags do return a hit on the ground and the sides. OnControllerColliderHit only returns info on one of the collided surfaces (seemingly giving priority to the ground collision), from what I can gather. Unfortunately, it seems that the object colliders do not sense collisions with the Character Controller. :cry:

The info that I really need is the normal and the object tag of all collided objects.

After a few failed approaches I did end up using the Physics.Raycast() function which seems to be giving me access to the data that I need. When the Character Controller gives me a side collision I shoot a ray from the center of the capsule in both directions (the size of the capsule radius + 0.1) to find out what I am hitting, allowing me to get the normal and object tag.

It looks like this is indeed the solution that you are recommending, but I am all ears if there is a better and more obvious solution! :slight_smile: