So nothing very complicated. I also did a code to move the main camera when I press arrows of the keyboard. The issue is that I want to prevent the camera to show something else than the map.
For example, you can see on the camera preview that some blue can be seen on the screen. Basically, I guess I should inspect the white line of the camera and see when it touches the edge of the terrain but I really don’t know how to achieve that.
It is actually not so easy!
Easy way: 1/ constrain you camera position so it can never go too far outside (use clamp function)
2/ plan an external terrain just to avoid seeing void.
Constraining the camera view to the terrain is also doable, but the camera won’t be able to move a lot. For this, you first need to know what your camera sees (that function must be called at each move):