How to set the camera size which is equal to the screen resolution?

Sorry, my English is not good.
I am a U3D starter,

I create 2 cameras, one is called Camera2D , another is Camera3D.

I want create a game which has 3D scenes, Camera3D will move to show scenes,

but Camera2D won’t move and show the pics’ prefabs (all pics objects have their locations depend on the screen.width and height, and change locations according to a timer, but their vectors just are in 2D plane so Camera2D show them as 2D pics (and Camera2D to the pics distance almost be 0)

my question is I want the camera “Camera2D” size equals to the screen like 1280*768.
and I have set the Camera2d location to half of screen.width and height, the screen’s center players can see.

how I can do? thanks!

Hi, welcome to the forum!

A camera doesn’t have a fixed pixel resolution but it does have an aspect ratio (ie, width divided by height). Just divide Screen.width by Screen.height and set assign this value to the camera’s aspect field.

As for reducing the size of the view onscreen, you can set the camera’s normalized viewport rectangle from the inspector. The rectangle’s position and size are specified as fractions of the total screen size, so if you set width and height to 0.5, the view rectangle will be half as wide and tall as the screen.