Play()
Starts the camera.
Read time 1 minuteLast updated 4 days ago
Definition
- Type: Method
- Namespace: UnityEngine
- Assembly: UnityEngine.AudioModule
public void Play()
Remarks
Call Application.RequestUserAuthorization before creating a WebCamTexture.
Examples
// Starts the default camera and assigns the texture to the current rendererusing UnityEngine;using System.Collections;public class ExampleClass : MonoBehaviour{ void Start() { WebCamTexture webcamTexture = new WebCamTexture(); Renderer renderer = GetComponent<Renderer>(); renderer.material.mainTexture = webcamTexture; webcamTexture.Play(); }}