Character controller rotation workaround

I’m trying to create a gravity system that allows me to change object’s gravity direction in specific areas. I’m currently using trigger colliders that rotate the objects inside towards the gravity direction

206302-gravity.gif

This system works fine for objects but the player has problems with it’s player controller

206303-screenshot-2023-04-10-211303.png

The character controller’s collider doesn’t rotate like the rest of the player. This leads to problems with the Move() function as it no longer moves up slopes correctly.

From other questions I learned that it’s not possible to rotate the character controller:
https://answers.unity.com/questions/776619/rotate-character-controller.html
https://answers.unity.com/questions/1238111/rotating-a-character-controller-object.html

As the gravity switch is a rather big mechanic in my game, I’m searching for a workaround. I’ve been thinking of rotating the whole world around the player instead but haven’t really come up with a nice implementation.

I’m feeling kinda stuck, so thanks already in advance for any suggestions

To work with gravity so finely, you need to use the Capsule Collider and a Rigidbody-based character controller.

This might be helpful: GitHub - chetan-code/RigidbodyRaycastBased-CharacterController3D-Unity: A 3d raycast based rigidbody controller to move a character in unity3d.