Search Unity

which namespace

Discussion in 'Scripting' started by alexander, Apr 23, 2008.

  1. alexander

    alexander

    Joined:
    Mar 28, 2008
    Posts:
    180
    Hi,

    that is my current code:
    Code (csharp):
    1.  
    2. function Update () {
    3.     if (Input.GetButtonDown ("Jump")) {
    4.         if (renderer.material.mainTexture.isPlaying) {
    5.             renderer.material.mainTexture.Pause();
    6.         }
    7.         else {
    8.             renderer.material.mainTexture.Play();
    9.         }
    10.     }
    11. }
    12.  
    13.  
    14.  
    15. function Stop () {
    16.     renderer.material.mainTexture.Stop ();
    17. }
    18.  
    But I'm getting this error message in the console:
    error BCE0019: 'renderer' is not a member of 'UnityEngine.MovieTexture'.
    (Where) have I got to insert "MovieTexture"?

    thx
     
  2. AngryAnt

    AngryAnt

    Keyboard Operator

    Joined:
    Oct 25, 2005
    Posts:
    3,045
    Which line is the error referring to?
     
  3. alexander

    alexander

    Joined:
    Mar 28, 2008
    Posts:
    180
    In the example above is it the third line with the "isPlaying".
     
  4. AngryAnt

    AngryAnt

    Keyboard Operator

    Joined:
    Oct 25, 2005
    Posts:
    3,045
    Is this the entire contents of the source file? What is the name of the file?
     
  5. alexander

    alexander

    Joined:
    Mar 28, 2008
    Posts:
    180
    No, it isn't the entire code.
    But the code I've left is a menu and the variables, which isn't important.

    The name of this file is "Sub6_VidGUI.js".
     
  6. AngryAnt

    AngryAnt

    Keyboard Operator

    Joined:
    Oct 25, 2005
    Posts:
    3,045
    Have you yourself defined a variable named renderer somewhere?
     
  7. alexander

    alexander

    Joined:
    Mar 28, 2008
    Posts:
    180
    No, I haven't.

    Could it be, that my unity is griping, cause it's only unity indie?
    Read (after testing...) that movies are only possible with the pro-version?
     
  8. AngryAnt

    AngryAnt

    Keyboard Operator

    Joined:
    Oct 25, 2005
    Posts:
    3,045
    Ah right! Of-course! That'd be why you're getting the error. MovieTextures are disabled at the basic level in indie.
     
  9. alexander

    alexander

    Joined:
    Mar 28, 2008
    Posts:
    180
    And also the code for MovieTextures is disabled?!
    Wow - okay.

    Thank you AngryAnt