Thanks! Yes I know the instructions weren't clear enough, I didn't have the time to properly design the things, I just randomly implemented my ideas. The cause of the problem is that I came up with this movement system (walk on ground, crawl on wall) but the same time I tried to use the physics of unity and the result is buggy because sometimes random edges rotate the player and then the whole thing is screwed.
Thanks for your kind words anyway!