It is best not to use methods such as MoveTo to move characters in rpg. It is best to use setPosition to give your hero a speed speed(Vec2(speedX, speedY)), and then click to trigger movement in one direction. Note that you can keep the camera still and let the background map move. Each frame (in update) goes to pos.x += or -= speedX, pos.y += or -= speedY.
As for the peripheral positions that can be moved but the middle positions that remain unchanged: you can set up a conditional judgment in the update to move the background in the center, otherwise the hero will be moved and the hero will not be allowed to move out.
It is best not to use methods such as MoveTo to move characters in rpg. It is best to use setPosition to give your hero a speed speed(Vec2(speedX, speedY)), and then click to trigger movement in one direction. Note that you can keep the camera still and let the background map move. Each frame (in update) goes to pos.x += or -= speedX, pos.y += or -= speedY.
As for the peripheral positions that can be moved but the middle positions that remain unchanged: you can set up a conditional judgment in the update to move the background in the center, otherwise the hero will be moved and the hero will not be allowed to move out.
Hope the answer is useful to you.