• Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
2
Question by Kevin Laity · Feb 09, 2010 at 10:34 PM · movietexture

Rewinding a MovieTexture

Is there a reliable way to rewind a movie texture? (Without then playing the movie)

stop() doesn't do it, and play() then stop() doesn't do it.

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

4 Replies

· Add your reply
  • Sort: 
avatar image
2
Best Answer

Answer by MaDDoX · Jul 06, 2010 at 05:32 AM

I can confirm this bug. It happens both in editor and in the built versions. It doesn't happen the very first time you execute the script though, that's why a just-built version seems to not have the bug. If you re-load the scene again, it also won't happen in editor.

I'll describe the only workaround I found. Bear in mind that I'm trying to reset and play an animation that starts with a fully black frame to be used as fully transparent in an movie texture alpha channel. I use a play+pause then yield twice in the start block, I found that two yields is the minimum to get this to work. If your mov is at 30 FPS you'll need at least 4 frames of headroom at the start of your movie, if you want to "fade it in". In my case I use 60 FPS so I've added 8 extra starting black frames in After Effects. Follows the code I've used:

function Start () { mask = renderer.material.GetTexture ("_Mask"); mask.Stop(); mask.Play(); yield; yield; // Every yield = ~2 .mov Frames @ 30 FPS; mask.Pause(); }

function Update () { if (Input.GetButtonDown ("Jump")) { mask.Play(); } }

GLHF!

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
2

Answer by lowbloodsugar · Feb 10, 2010 at 02:19 AM

You might want to check out the QT plugin in the wiki. It has more comprehensive video playback controls. It is harder to use though and requires unity pro.

Alternatively, you might be able to restart the video using a secondary material that is hidden off screen and juggling the materials...

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by TrolleFar · Jun 02, 2010 at 08:54 AM

In my experience the movie texture behaves differently when used in the editor and in a compiled game. So try and use the Stop() method and see how it behaves if you build a standalone version. If I remember correctly it works as documented when used outside of the editor.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by jonas-echterhoff · Jun 07, 2010 at 11:41 AM

I cannot reproduce this in either 2.6.1 or current builds - (using Stop() and then Play()). Could you file a bug report with an example project on how to get to this issue, so we can fix it?

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Welcome to Unity Answers

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

Follow this Question

Answers Answers and Comments

No one has followed this question yet.

Related Questions

How to get current frame number of a playing MovieTexture? 1 Answer

Problems with movies - delayed play or silent failure 2 Answers

how can i put button to stop this movie? 2 Answers

WWW.movie doesn't work 1 Answer

[SOLVED]my original texture change to movie texture 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges