Search Unity

Movie Texture Basic Problem

Discussion in 'Scripting' started by grimmy, Jun 21, 2010.

  1. grimmy

    grimmy

    Joined:
    Feb 2, 2009
    Posts:
    409
    Its my first time playing a movie texture and the following gives me an error.(MovieTexture is not a member of material)
    Code (csharp):
    1. var movieScreen:GameObject=GameObject.Find("MovieScreen");  movieScreen.renderer.material.mainTexture.Play();
    Why?
     
  2. grimmy

    grimmy

    Joined:
    Feb 2, 2009
    Posts:
    409
    Anyone?
    P.S I have Unity Pro.
     
  3. grimmy

    grimmy

    Joined:
    Feb 2, 2009
    Posts:
    409
    I just cut and pasted the EXACT script from the help file and that gives me thefollowing error! ' 'Play' is not a member of 'UnityEngine.Texture'

    Whats going on???

    Code (csharp):
    1. function Start()
    2. {
    3.     renderer.material.mainTexture.Play();
    4. }
    ??
     
  4. grimmy

    grimmy

    Joined:
    Feb 2, 2009
    Posts:
    409
    Is there anyone from Unity that can help me out here? I have Unity Pro and a deadline on friday which requires a movie playing.

    HELP!
     
  5. grimmy

    grimmy

    Joined:
    Feb 2, 2009
    Posts:
    409
    I removed the #pragma strict from the top of my script and I get no errors. I haven't a clue why, but it works!!

    But then if I try to access the movie script from another script it breaks again. ???!!?
     
  6. grimmy

    grimmy

    Joined:
    Feb 2, 2009
    Posts:
    409
    I also get MissingFieldException: Field 'UnityEngine.Texture.isPlaying' not found.
    Boo.Lang.Runtime.PropertyDispatcherFactory.FindExtension (IEnumerable`1 candidates)

    I'm pretty sure this is a Unity bug now.. Unity guys?

    (ever get the feeling that you are talking to yourself?)
     
  7. andeeeee

    andeeeee

    Joined:
    Jul 19, 2005
    Posts:
    8,768
    Sorry it took a while to get back to you!

    The material's texture is declared as the parent Texture class. However, the Play function is specific to the MovieTexture subclass, so you need to help the compiler out a bit:-
    Code (csharp):
    1. var mov: MovieTexture = renderer.material.mainTexture;
    2. mov.Play();
     
  8. grimmy

    grimmy

    Joined:
    Feb 2, 2009
    Posts:
    409
    Many thanks!!!
     
  9. danish

    danish

    Joined:
    Dec 27, 2012
    Posts:
    10
    Thanks Mr. Andee your guidance always help us alot, carry on.
     
  10. Ankit-Priyarup

    Ankit-Priyarup

    Joined:
    Mar 7, 2013
    Posts:
    52
    In my case it's showing an error

    Assets/play.js(2,18): BCE0018: The name 'MovieTexture' does not denote a valid type ('not found').

    $Screenshot (143).png
     
  11. lorenalexm

    lorenalexm

    Joined:
    Dec 14, 2012
    Posts:
    307
  12. moner

    moner

    Joined:
    Apr 13, 2015
    Posts:
    1
  13. Mhmdsaab_7

    Mhmdsaab_7

    Joined:
    Aug 3, 2015
    Posts:
    1
    Is it required to have Unity3d to be able to import video to unity projects?