Optimized the character locomotion system.