Collision in a rotating cube

Hi,

I got a problem with collision i cant solve. I Searched the forums now for some hours and tried to solve it myself for a long time but i get stuck with this problem.

I use the FPSWalker and CharacterController-script and i am inside a cube. If i hit a trigger i want to rotate the cube 90 degrees(not instant). The trigger is on at a wall. When I do this one side of the cube becomes the new bottom.

But there comes the problem. I move a bit down while it is rotating but in the middle of the rotation I fall through the wall (the new bottom) outside of the cube.

Can anyone point me to a solution how I can handle the collision proper so that the wall push me a bit to the side instead of stucking into the wall?

Thx for help
Reno

How are you constructing the cube? If you are using the inside of a box collider, then I’m not sure you will get reliable results. In this case, try creating a separate thin box collider for each of the walls.