Video Texture Loop

Hi all!

I’m trying to put a video as a texture on a cube like a tv, with the intention of a repeat loop continuously, but the video only played once.

I use a simple script:

renderer.material.mainTexture.Play ();

but I do not know how to assign parameters to do a loop.

Could anyone help?

Thank you!

2 Answers

2

try this

Thanks Luckd93!! i must add movTexture.loop = true; nd this is the final scripts that works: var movTexture : MovieTexture; function Start () { movTexture.loop = true; renderer.material.mainTexture = movTexture; movTexture.Play(); } THANKS!

That should have been a comment not an answer. - Read this page : http://answers.unity3d.com/page/newuser.html - Please watch : http://video.unity3d.com/video/7720450/tutorials-using-unity-answers

it is my first time...

I guessed that. I posted the comment so that you will avoid doing this next time. Welcome to Unity Answers :)

Converted to comment, using the 'more' dropdown

// this line of code will make the Movie Texture begin playing
renderer.material.mainTexture.Play();
renderer.material.mainTexture.loop = true;