How do you have a webcam feed as the background?

I’ve tried using this solution: fullscreen webcam texture behind everything? - Unity Answers

but the build comes up with loads of errors. I’m very new to this and I don’t really understand what I’m doing wrong.

This is the full code I’ve attached to a texture, as the guide suggests.

using UnityEngine;
using System.Collections;
public void Initialize(){
	Debug.Log("Initialize");
	
	BackgroundTexture = gameObject.AddComponent<GUITexture>();
	BackgroundTexture.pixelInset = new Rect(0,0,Screen.width,Screen.height);
	//set up camera
	WebCamDevice[] devices = WebCamTexture.devices;
	string backCamName="";
	for( int i = 0 ; i < devices.Length ; i++ ) {
		Debug.Log("Device:"+devices_.name+ "IS FRONT FACING:"+devices*.isFrontFacing);*_

_ if (!devices*.isFrontFacing) {
backCamName = devices.name;
}
}*_

* CameraTexture = new WebCamTexture(backCamName,10000,10000,30);*
* CameraTexture.Play();*
* BackgroundTexture.texture = CameraTexture;*

}`
I’m sure I’m missing something very obvious. Assume that I know nothing in your answers please!

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class SetWebcamBG : MonoBehaviour {
	void Start () {
		GUITexture BackgroundTexture = gameObject.AddComponent<GUITexture>();
		BackgroundTexture.pixelInset = new Rect(0,0,Screen.width,Screen.height);
		WebCamDevice[] devices = WebCamTexture.devices;
		string backCamName = devices[0].name;
		WebCamTexture CameraTexture = new WebCamTexture(backCamName,10000,10000,30);
		CameraTexture.Play();
		BackgroundTexture.texture = CameraTexture;
	}
}

The C# script above sets your background to the first webcam found in the devices list. Put this into your assets folder and add the script "SetWebcamBG " to any gameObject.

You need to embed that function into a c# script, which derives from MonoBehaviour.