Thanks for the comments, it works alot better now. There is still one big bug in it, the function also moves my character forwards or backwards (depending on my characters tilt). E.g. when my character looks up and I press the jump key, he also moves backwards. And when my character looks down and I press the jump key, he moves forwards. I think it has something to do with the GLIDE mode in the C_move function, but I don't know which other mode I could use (if the problem indeed lies with the GLIDE mode).