how to make a plane display what a camera is capturing?

so i want to make an object like a plane or a face in a cube or something display what a camera is capturing, to make a security system, but i have no idea if its possible. if someone could tell me if its possible and hopefully link me to a tutorial, that would be great. thanks

Look at the below link it will help you.

Try this code attached on your Plane and it will display your webcam on it. It does so by replacing the material of the plane with a WebCamTexture material.

using UnityEngine;

public class DisplayWebcam : MonoBehaviour {

	void Start() {

		Debug.Log("DisplayWebcam Initialize");

		// Transform values of the plane to get you started:
		// position 0   0   200
		// rotation 90  180 0
		// scale    80  1   40

		var devices = WebCamTexture.devices;
		var backCamName = "";
		if(devices.Length > 0) backCamName = devices[0].name;
		for(int i = 0; i < devices.Length; i++) {
			Debug.Log("Device:" + devices_.name + "IS FRONT FACING:" + devices*.isFrontFacing);*_

_ if(!devices*.isFrontFacing) {
backCamName = devices.name;
}
}
var CameraTexture = new WebCamTexture(backCamName, 10000, 10000, 30);
CameraTexture.Play();
var renderer = GetComponent();
renderer.material.mainTexture = CameraTexture;
}
void Update () {
}
}*_