Positioning 3D walls according to device size

Godot Version

4.3

Question

My 3D Mobile game has 3D walls around the edges. Wall collisions prevent objects from coming out. In the Projects Settings/Window section, I set the stretch mode to “canvas_items” and “expand”. However, in this mode, the position of the walls is not automatically scaled when the game is run on different screen sizes.
When I set “canvas_items” to “keep”, blackness appears at the top and bottom of the screen on narrow screen sizes, and on the right and left of the screen on wide screens.

Blacks formed in “canvas_items” “keep” mode:


How should I find a solution to automatically position 3D Walls based on device size?