This paper proposes a motion generation method in unknown environments. Living environments for human beings is complicated for human-friendly robots. Robot designer can't prepare complete motions beforehand. There are some previous researches to acquire new suitable motion for each environment. It isn't easy to acquire new suitable motion from scratch. In the proposed method, new motion is generated based on motion designed or acquired in another environment. Generated motion adjusts for each environment by referring sensor values while moving. The proposed mothod is applied to a walking motion of four-legged robot and experimental results show the motion for an environment is adjusted to another environment.