Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • 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
0
Question by aiibee · Nov 09, 2012 at 06:56 PM · videoloop

Loop Video forever

hello,

i have been looking for a script that will loop the video. I am learning scripting, please bare with me

here is the code i found

  var movieTexture : MovieTexture;
  function Start() {
  movieTexture.loop = true;
  renderer.material.mainTexture = movieTexture;
  movieTexture.Play ();
  }


but it is not working for me. do i need to change the naming connection.

Comment
Add comment · Show 2
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 elliottebbs · May 08, 2013 at 04:07 PM 0
Share

I'm experiencing the same problem please paste the working code for looping movie texures. Ive tried every combination but can't get it to work.

avatar image Fattie · Nov 13, 2014 at 01:05 PM 0
Share

LOO$$anonymous$$: http://answers.unity3d.com/questions/148269/how-do-you-prevent-looping-video-from-flashing-at.html

2 Replies

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

Answer by liszto · Nov 10, 2012 at 01:16 AM

This must work :

 var movieTexture : MovieTexture;
 
  function Start() {
  movieTexture.loop = true;
  renderer.material.mainTexture = movieTexture;
  movieTexture.Play ();
  }

Really strange that this doesn't work for you Oo

did you specify your video in the public field of your script ?! In the Unity inspector ?

Comment
Add comment · Show 6 · 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 aiibee · Nov 10, 2012 at 09:16 PM 0
Share

"did you specify your video in the public field of your script ?! In the Unity inspector ?"

Could you explain to me how you would do this?? I am learning not sure what it is I have to do.

What I have done is made a plane, made a material for it, and than assigned the video to it and that is it. I copy and paste the script you have given me, but it does not work. It gave me errors.

avatar image aiibee · Nov 10, 2012 at 09:18 PM 0
Share

also if i have a sound with my video, it does not play it at all. so i took the audio, and rendered it separately. I have attached it to the plane, bye when I play it it is not in sync.

avatar image liszto · Nov 10, 2012 at 11:22 PM 0
Share

put the script on your camera and on the right side when you click on your camera you must see a empty field to drag/drop your video.

For the sound can you show me your script you probably do a mistake. Just show me.

avatar image aiibee · Nov 12, 2012 at 09:31 PM 0
Share

var movieTexture : $$anonymous$$ovieTexture;

function Start() { movieTexture.loop = true; renderer.material.mainTexture = movieTexture; movieTexture.Play (); }

I got this code to work, but the audio is playing out of sync.

I am also using this java script as a movie to play before the game starts. and on both the audio is not playing corectly. Is there a specific file structure I need to render the Video.

function Start () {
renderer.material.mainTexture.Play(); }

function Update(){ if(!renderer.material.mainTexture.isPlaying) Application.LoadLevel(1); }

avatar image liszto · Nov 14, 2012 at 07:14 PM 0
Share

Sorry I can't explain my script right now but you can find here how I read my video in one of my games :

http://pastebin.com/JTRtEEEX

Hope you gonna understand it. If you have some questions, ask them. I'll be back :)

Show more comments
avatar image
0

Answer by absolutegames1 · Jul 09, 2013 at 05:21 PM

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

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.

Follow this Question

Answers Answers and Comments

14 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

How to pause a video automatically? 1 Answer

Video Texture Loop 2 Answers

Video Texture Loop on TV 0 Answers

How to loop a video texture in C# 1 Answer

How to play loop an audio clip on button hold down? 2 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