Problems with webcamtexture

I’m trying to make an app that will effectivley turn a tablet into a PDA from this game called Subnautica. I’m having a little problem with the camera however. I’m aiming to make the camera something like a normal camera, However I’ve run into a little problem:I initalize the webcamtexture in the start function, so I can’t access it from my public function which takes the picture. I’ve tried initalizing the webcamtexture in the takepicture function, and as a field declaration, but those both give me errors and cause the camera to break, so what can I do to make this work(I Do not want any plugins that cost money)(also, It would be great if the webcamtexture could be initalized from another script, as this page can be instantiated and destroyed, and unity doesn’t like it when there are 2 webcamtextures in one scene)? Any help is greatly appreciated. Code:

public RawImage displayimage;
public Texture2D phototexture;
void Start ()
{
WebCamTexture webcamTexture = new WebCamTexture();
displayimage.material.mainTexture = webcamTexture;
webcamTexture.Play();
}
public void takepicture(){
//this is where I convert the webcamtexture into a texture2D.
}

Never mind, I fixed it, Just initalize webcamtexture as a field initalization, but do the “webcamtexture = new webcamtexture()” bit in the start function.