Search Unity

Can't get video clip textures to work

Discussion in 'Editor & General Support' started by userInput, Aug 7, 2011.

  1. userInput

    userInput

    Joined:
    Nov 16, 2010
    Posts:
    47
    Yes, I know, this should be easy and I'm probably making it harder than it is, but I cannot figure out how to place a video clip onto a flatten plane to simulate a computer screen. I thought I had placed the script in properly, applied any necessary settings, but when I go to play my game, the plane is still blank with no animation. I rotated it, and nothing on the other side either, still blank. I just need the video clip to play on the flat screen and loop over and over again. Yes, I'm using Unity Pro. I feel like the approach that I've taken has been all wrong and I really want to start over. Please help and be gentle, still learning here. Thanks in advance!
     
  2. zine92

    zine92

    Joined:
    Nov 13, 2010
    Posts:
    1,347
    Is there any warnings or error? According to the manual for movie texture. It says to play the movie, you will need
    Code (csharp):
    1.  
    2. // this line of code will make the Movie Texture begin playing
    3. renderer.material.mainTexture.Play();
    4.  
    Try this. Hope it helps. :D
     
  3. Dreamora

    Dreamora

    Joined:
    Apr 5, 2008
    Posts:
    26,603
    That will potentially not work as mainTexture is of Texture2D not MovieTexture
    so it would be something like

    Code (csharp):
    1.  (renderer.material.mainTexture as MovieTexture).Play();
    or if you assign it through code, just use the original MovieTexture instance you got
     
    Last edited: Aug 8, 2011
    Fahadrajput likes this.
  4. zine92

    zine92

    Joined:
    Nov 13, 2010
    Posts:
    1,347
    Sorry just posted what the manual written and wasn't really tested.
     
  5. userInput

    userInput

    Joined:
    Nov 16, 2010
    Posts:
    47
    Okay so in terms of scripting all I need is a file called movieTexture.js with that line of code you gave me and attach that file to the texture in the inspector panel?
     
  6. userInput

    userInput

    Joined:
    Nov 16, 2010
    Posts:
    47
    This line of code is not working. I haven't compiled or run anything and it's already giving me an error: Says that it's expecting the semi-colon at the end and the semi colon is at the end, but I put it in just as you had it, dreamora.
    renderer.material.mainTexture as movieTexture.Play();

    Not working. Please tell me what's wrong, I haven't done this before and I need more specific instructions
     
  7. Dreamora

    Dreamora

    Joined:
    Apr 5, 2008
    Posts:
    26,603
    you are missing the parenthesis there
     
  8. userInput

    userInput

    Joined:
    Nov 16, 2010
    Posts:
    47
    You say "there" but I don't know where the parens are supposed to go. Please understand who you are dealing with. I've been trying to explain that I need a step by step explanation. The answers I've gotten so far are too vague. Please help me, because so far, I have no idea what's going on.
     
  9. userInput

    userInput

    Joined:
    Nov 16, 2010
    Posts:
    47
    Please, I've been trying to explain that I need help getting video clips to play in Unity and I cannot get it to work. This is my first time using video clips and applying them as textures, so I do NOT know ANYTHING about how this works. Please, Please, PLEASE give me detailed step by step instructions as I do not know how this works. I just need to get a video clip to play on an endless loop once the game starts. PLEASE HELP ME!!!
     
  10. Dreamora

    Dreamora

    Joined:
    Apr 5, 2008
    Posts:
    26,603
    Look at my code posted above and you will see where your code is missing them
     
  11. userInput

    userInput

    Joined:
    Nov 16, 2010
    Posts:
    47
    Okay, I copied the code exactly as you had it on that line above, now what do I do?
     
  12. Dreamora

    Dreamora

    Joined:
    Apr 5, 2008
    Posts:
    26,603
    have a movie texture in the material that you are requesting there.
     
  13. userInput

    userInput

    Joined:
    Nov 16, 2010
    Posts:
    47
    How is that done?
     
  14. SteveJ

    SteveJ

    Joined:
    Mar 26, 2010
    Posts:
    3,042
  15. userInput

    userInput

    Joined:
    Nov 16, 2010
    Posts:
    47
    I don't understand what you mean. We're already in the forums. I've speant weeks googling and seeking help. Yes, I am using Unity Pro.
     
  16. userInput

    userInput

    Joined:
    Nov 16, 2010
    Posts:
    47
    Also, I checked those links that you posted and I already was at some of those sites and the rest of the information was not helpful and I am still struggling for an answer to this. Lots of other pages regarding this subject, are only confused users who do not know that Unity Pro is the only version that you can use with animated textures.
     
  17. userInput

    userInput

    Joined:
    Nov 16, 2010
    Posts:
    47
    Okay, so I've got some progression. The video clip is showing up on the plane, however it suddenly stops and I get a warning saying, "The referenced script on this Behaviour is missing!" I don't understand what this means. Why is this happening?
     
  18. Dreamora

    Dreamora

    Joined:
    Apr 5, 2008
    Posts:
    26,603
    that means that somewhere is a game object with a "missing behavior" instead of a script hooked up
     
  19. userInput

    userInput

    Joined:
    Nov 16, 2010
    Posts:
    47
    But I dragged the script to the behaviour mono script in the inspector panel in order to attach it. I thought this was the correct move, but it must not be. What are the proper steps please? I really need to get this done soon and I'm really struggling.
     
  20. Dreamora

    Dreamora

    Joined:
    Apr 5, 2008
    Posts:
    26,603
    this is correct to do it that way.

    nobody said that the error comes from this game object
     
  21. userInput

    userInput

    Joined:
    Nov 16, 2010
    Posts:
    47
    But with nothing wrong with the script, and having it attached properly as you say, then what's the problem??? It's not an error, its a warning.
     
  22. userInput

    userInput

    Joined:
    Nov 16, 2010
    Posts:
    47
    The looping part is working now too. I had to check the loop box, but that still doesn't explain that warning that I'm getting.
     
  23. zine92

    zine92

    Joined:
    Nov 13, 2010
    Posts:
    1,347
    Read the manual. It would be much faster.
     
  24. Mingo

    Mingo

    Joined:
    Nov 14, 2010
    Posts:
    39
  25. appels

    appels

    Joined:
    Jun 25, 2010
    Posts:
    2,685
  26. zine92

    zine92

    Joined:
    Nov 13, 2010
    Posts:
    1,347
    Maybe it's your other scripts. Note this happens if by accident you opened your folders in explorer/finder and you moved the scripts accidentally. This causes your scripts to lose connections. Just check all the gameobjects and see in the inspector, is there any component which says missing mono or something similar and just remove that component or redrag the old scripts into that. :D
     
  27. zine92

    zine92

    Joined:
    Nov 13, 2010
    Posts:
    1,347
    Imagine everyone like you. Wanting to seek help and how is it possible that everyone gets the help equally. Be patient. All the people here have a life. And please bump your older threads instead of posting new ones. We are all here to help so be nice too, Do you think when we have problems it just solves itself. We also spend lot more time searching and debugging on our own before asking nicely.
     
  28. Fahadrajput

    Fahadrajput

    Joined:
    May 8, 2018
    Posts:
    1
    I want to play video at runtime by explorer this will works?
     
unityunity