Positioning wall at border of viewport

Hi,
I want to position wall at border of the viewport to have a tunnel and I can figure out how to do it
I’m using ViewportToworldpoint but it doesn’t work

For example for the left wall I want to have it at the left border, center. So it should be x=0, y=0.5 to have the center in the middle of the left border of viewport

So i’m using
Vector3 LeftWallPosition = Camera.main.ViewportToWorldPoint(new Vector3(0, 0.5f, 0));
LeftWall.transform.position = LeftWallPosition;

The result is that my wall is positionning at the same position as the camera so in the very center of the screen.

I don’t understand why.

Look in the docs (Unity - Scripting API: Camera.ViewportToWorldPoint) for the example. Esp. “the z component is the distance of the resulting plane from the camera.”

Your code says to start at the camera, and follow that diagonal camera edge for Z meters, but Z is zero.