Character move function modified.