Boundaries in the scene

Hello, I have a difficulty in my game and I’m a little bit confused on how to proceed

I have a square terrain of size 100x100. The game is targeted for mobile and everything is working as expected. The camera is a perspective one located above the terrain with a little angle (like diagonally), and the user can pan with his finger in the screen and the camera moves. The problem I have is that I don’t know how to set some boundaries to the scene so that the camera can’t go outside of it. I already created some walls around the scene with planes but I just can’t figure out how to make the camera to not cross this walls (sorry for my bad english). Maybe is a noob problem, but I’m stuck with this

I would really appreciate any idea on how to resolve this

Thanks in advance

The width by height of your camera is decided by your aspect ratio. The height of your camera is usually always the same, but the camera will show more or less on the left and right depending on how wide your aspect ratio is.

To solve this, you can either design your game so that the camera can expand out to the largest supported aspect ratio, or force the game to use smaller aspect ratios. (The last option under “Resolution and Presentation” in player settings)

Warning: Using thin aspect ratios on wide monitors in a fullscreen game will make the screen appear stretched.

To see how the game looks with certain aspect ratios, you can select your aspect ratio in the upper-left of the Game window in Unity.

Hope this helps!