Character Walk on a Wall? (E.g Sonic running around a loop)

What a coincidence, I also recorded my progress regarding this matter. I also used C++.

Watch video here