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 killer-zog · Jul 05, 2013 at 10:30 PM · guiasyncmovieloading screenlevelload

LoadLevelAsync movie not playing gui!!

hi i am having problem with making loading screen while the level loads in the background. i am using loadlevelasync function. but the problem is i also have a loading movie, and a loading background image, the images show as planned, however the movie is not playing.

i think the problem is that the level loads before the movie gets any chance to play. so how to solve this, i want to play the movie as loading the level in bg and when the loading is done, it switches to the loaded level.

i am using GUI box to show images and play the movie. here is my code,

 var skin:GUISkin;
 public var guiDepth : int = 0;
 var image: Texture2D;
 public var backgroundaudio: AudioClip;
 public var PlayVid : MovieTexture;
 
 function Start () {
         // Load the level named "MyBigLevel".
         var async : AsyncOperation = Application.LoadLevelAsync ("round1");
         yield async;
         Debug.Log ("Loading complete");
     }
    
     function OnGUI()
     {
 GUI.depth = guiDepth;
 GUI.Box(Rect (0,0,Screen.width,Screen.height), image);
 
 
        PlayVid.loop = true;
        PlayVid.Play();
     GUI.DrawTexture(Rect (Screen.width - 260,Screen.height - 110,260,110), PlayVid);
 
 }
 
Comment
Add comment · Show 1
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 Benproductions1 · Jul 06, 2013 at 06:25 AM 0
Share

Why not just not have the movie object destroyed on scene load, then disable scene activation, once the move has completed, activate the scene :)

1 Reply

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

Answer by MaddyGm3R · Jul 06, 2013 at 07:40 AM

Hi You have put PlayVid.Play(); in the OnGUI function. This will give call to play the video in each onGUI call, but never play it completely as next Play is called before the video can render the next frame. Put PlayVid.Play(); in the start function and watch the magic.

Comment
Add comment · Show 1 · 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 killer-zog · Aug 06, 2013 at 09:12 AM 0
Share

sorry for this late response, was kinda busy. thnx for the tips it worked, though when i play the game in the editor nothing happens, but in the build it worked, guess in the editor the level load completes so soon that the video got no chance to play.

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

17 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 avatar image avatar image avatar image

Related Questions

LoadSceneAsync with objects retrieved from server 0 Answers

How stocked the video in full screen in the background? 0 Answers

Movie GUI Texture Alpha? 1 Answer

GameManager Problem with loading scene 1 Answer

www.movie on GUI Texture in front of Camera 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