The problem of walking machine leg transfer is considered. Optimal laws of transfer are determined with regards to geometrical features of ground and underwater. Complex optimality criterion is introduced as sum of indexes of quality of the movement multiplied each by weight coefficients. The solution is presented based on walking machine “Ortonog”.