Show device camera preview (Android & iOS)

Hi,
I’m new to Unity3D and I’m trying to create a simple example of how to use device camera. I did a little sample project, but can’t figure it out what’s the problem,because if I run the project on Android it doesn’t show camera preview. Here is the script and MainCamera and Place’s configurations:

![#pragma strict

function Start () {
	Debug.Log("Start");
	var devices: WebCamDevice[] = WebCamTexture.devices;
	for (var i: int = 0; i < devices.Length; i++)
		Debug.Log(devices*.name);*
  • var deviceCamera: GameObject = GameObject.FindWithTag(“Player”);*
  • var webcamTexture: WebCamTexture = new WebCamTexture();*
  • deviceCamera.GetComponent.().material.mainTexture = webcamTexture;*
  • webcamTexture.Play();*
    }

function Update () {

  • Debug.Log(“Update”);*
    }][1]

Any kind of help and suggestions are welcomed!
Thanks in advance!

I used RawImage as live window and it worked

public class LiveShowWindow : MonoBehaviour {
    public RawImage rawimage;
    void Start() {
        WebCamTexture webcamTexture = new WebCamTexture(WebCamTexture.devices[WebCamTexture.devices.Length-1].name);
        rawimage.texture = webcamTexture;
        rawimage.material.mainTexture = webcamTexture;
        webcamTexture.Play();
    }
}