It seems to be quite a popular problem these days. I just put up a contribution under "Lite-C Contributions" that should help you out.

It's a function that takes an angle and two vectors (one from the world -- using "normal" after c_trace or c_move makes sense -- and one local vector that you want to align with the world one -- using "vector(0, 0, 1)" will make Sonic's feet line-up on the surface underneath him), and modifies the angle so that it lines up.

It doesn't use vec_to_angle.

Jibb


Formerly known as JulzMighty.
I made KarBOOM!