Added check to prevent characters from flying away during movement