Script Errors

Use Unity Pro
4.3.0f4

Script #1

renderer.material.mainTexture.Play();

Error #1

Assets/PlayVideo.js(1,31): BCE0019: ‘Play’ is not a member of ‘UnityEngine.Texture’.

Script #2

private var timer = 0.0; 
    var bobbingSpeed = 0.18; 
    var bobbingAmount = 0.2; 
    var midpoint = 2.0; 
     
    function Update () { 
       waveslice = 0.0; 
       horizontal = Input.GetAxis("Horizontal"); 
       vertical = Input.GetAxis("Vertical"); 
       if (Mathf.Abs(horizontal) == 0 && Mathf.Abs(vertical) == 0) { 
          timer = 0.0; 
       } 
       else { 
          waveslice = Mathf.Sin(timer); 
          timer = timer + bobbingSpeed; 
          if (timer > Mathf.PI * 2) { 
             timer = timer - (Mathf.PI * 2); 
          } 
       } 
       if (waveslice != 0) { 
          translateChange = waveslice * bobbingAmount; 
          totalAxes = Mathf.Abs(horizontal) + Mathf.Abs(vertical); 
          totalAxes = Mathf.Clamp (totalAxes, 0.0, 1.0); 
          translateChange = totalAxes * translateChange; 
          transform.localPosition.y = midpoint + translateChange; 
       } 
       else { 
          transform.localPosition.y = midpoint; 
       } 
    }

SO MANY ERRORS

ERRORS

“Unknown Identifier” means you use a variable name that you have not declared.
In Javascript / Unityscript, you must add the “var” keyword to declare a variable before you can assign a value to it.
But don’t do that in Update(). Declare them before the function in which you use them or at the top of your script.

Textures cannot be played. “Is not a member of” basically means you are trying to tell an object to do something that isn’t something that kind of object does.