Hello, How can i controll movie(avi) texture by scripting ? I want as slider play avi should play ? Thanx
Control over MovieTextures is currently very limited. It is possible to pause, stop and rewind, but there isn't any way to set the position of the playhead in the Unity API.
It is possible to rewind the movie texture? How? IMHO the function Stop () doesn't work correctly. (It just stop the movie, but doesn't rewind it) and in the scripting reference I see only the functions Stopp, Play and Pause but no rewind. We use a little workaround to correctly start/stop-movies. It is not a perfect solution but for the moment it's a usable workaround for us. Greets Jeromy
the Stop function will rewind the movie, but doesn't update the texture until you try to play it again. So if you want to restart a movie, you can do a Movie.Stop(); Movie.Play(); deal. and if you just want it to show the first frame you'll have to throw in some weird WaitForSeconds() stuff in there and then Movie.Stop(). The whole MovieTexture thing is very clunky. You're probably better off writing your own plugin for movie playback. It'll give you more control over the movie, if you need it.
That's exactly what I did in my script . The only different is, that I work with jield, not with WaitForSeconds().
right, well i meant you'd have to do something like Code (csharp): Movie.Stop(); Movie.Play(); yield return new WaitForSeconds(0.5f); Movie.Stop();