WebCam

Hello,

I have cube X that has a script

public class CameraPreview : MonoBehaviour {
    WebCamTexture FrontPreviewCam;
    string Frontcamera;

    // Use this for initialization
    void Start () {
   
        WebCamDevice[] devices = WebCamTexture.devices;   
        Frontcamera = devices[1].name;
   
        FrontPreviewCam = new WebCamTexture(Frontcamera,1920,1080,30);
   
        GetComponent<Renderer>().material.mainTexture = FrontPreviewCam;
        FrontPreviewCam.Play ();
    }

now i have a button B that when pushed I want it to pause the webcamtexture that is in cube X
how would i reference this in the button B Onmousedown script?

thank you

so i assume i need to make something like the fallowing.

    void CamPause(){
        FrontPreviewCam.Pause ();
    }

but not sure how to access that through the script that is on my button

anyone have any thoughts?

You could make a screenshot and display it while you pause