How to rotate Character depending on the inclination of the platform or its parts?

Hi! I make a Sonic game in Unity. This game requires 360 degrees character movement, because it has different platforms, including "Loops". How to make this movement? Thanks.

Raycasting from you char towards it's bottom (that is not down on the global Y axis) it'll hit the ground beneath it's feet and you'll get a RaycastHit which contains the hit ground's normal from which you can calculate the dir which goes along this surface using Vector3.OrthoNormaliz() which is the dir you should be able to move on the surface.

I'm not that smart but in 2D I'd do the actual rotation by finding the angle between the char's forward vector and the newly hit surface's paralell dir (the move dir I mean which you calced already) and rotate the char by it's forward axis by this angle.

Hope this gets you started :)

Sry if it wasn't too clear and another for my could-be-better-english and another if I said sg. totally non-sense.