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 PlanetGaming · Nov 11, 2013 at 12:30 AM · scene-loading

How do you create a loading screen?

I already have the artwork, but after playing with the scripts for a few hours; nothing has worked. I want something in the beginning that goes away after a few seconds to the main menu.

Comment
Add comment · Show 4
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 davooo0 · Nov 11, 2013 at 12:38 AM 0
Share

The splash screen? that shows your company logo at the very start of the game

avatar image Huacanacha · Nov 11, 2013 at 12:41 AM 0
Share

Have you tried something as simple as having a title Scene and a game Scene, making the title scene the first scene loaded (scene 0), then adding a simple timer that will call Application.LoadLevel to load the game scene?

avatar image davooo0 · Nov 11, 2013 at 12:43 AM 0
Share

yeah that is what i did at first but its very un smooth so i will post a script i found its quite easy to use and it does all the fading and ti$$anonymous$$g for you

avatar image AlucardJay · Nov 11, 2013 at 01:02 AM 0
Share

Please search before asking a duplicate question. Just a few search results :

  • http://answers.unity3d.com/questions/516872/splash-screens-multiple-images-game-intro.html

  • http://forum.unity3d.com/threads/31110-splash-screen-script

  • http://wiki.unity3d.com/index.php?title=SplashScreen

2 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by davooo0 · Nov 11, 2013 at 01:03 AM

ok just put this on the main camera of your splash screen level

 var guiDepth : int = 0;
 var levelToLoad : String = "";
 var splashLogo : Texture2D;
 var fadeSpeed : float = 0.3;
 var waitTime : float = 0.5;
 var waitForInput : boolean = false;
 var startAutomatically : boolean = true;
 var timeFadingInFinished : float = 0.0;
 var logoPositioning : LogoPositioning;
 var splashType : SplashType;
 enum SplashType {LoadNextLevelThenFadeOut, FadeOutThenLoadNextLevel}
 enum LogoPositioning {Centered, Stretched}
 private var alpha : float = 0.0;
 private var status : FadeStatus = FadeStatus.FadeIn;
 private var oldCam : Camera;
 private var oldCamGO : GameObject;
 private var splashLogoPos : Rect;
 private var loadingNextLevel : boolean = false;
 private enum FadeStatus {Paused, FadeIn, FadeWaiting, FadeOut}
  
  
 function Start()
 {
     if (startAutomatically)
     {
         status = FadeStatus.FadeIn;
     }
  
     else
     {
         status = FadeStatus.Paused;
     }
  
     oldCam = Camera.main;
     oldCamGO = Camera.main.gameObject;
  
     if (logoPositioning == LogoPositioning.Centered)
     {
         splashLogoPos.x = (Screen.width * 0.5) - (splashLogo.width * 0.5);
         splashLogoPos.y = (Screen.height * 0.5) - (splashLogo.height * 0.5);
  
         splashLogoPos.width = splashLogo.width;
         splashLogoPos.height = splashLogo.height;
     }
  
     else
     {
         splashLogoPos.x = 0;
         splashLogoPos.y = 0;
  
         splashLogoPos.width = Screen.width;
         splashLogoPos.height = Screen.height;
     }
  
     if (splashType == SplashType.LoadNextLevelThenFadeOut)
     {
         DontDestroyOnLoad(this);
         DontDestroyOnLoad(Camera.main);
     }
  
  
     if ((Application.levelCount <= 1) || (levelToLoad == ""))
     {
         Debug.LogWarning("Invalid levelToLoad value.");
     }
 }
  
  
  
 function Update()
 {
     switch(status)
     {
         case FadeStatus.FadeIn:
             alpha += fadeSpeed * Time.deltaTime;
         break;
  
         case FadeStatus.FadeWaiting:
             if ((!waitForInput && Time.time >= timeFadingInFinished + waitTime) || (waitForInput && Input.anyKey))
             {
                 status = FadeStatus.FadeOut;
             }
         break;
  
         case FadeStatus.FadeOut:
             alpha += -fadeSpeed * Time.deltaTime;
         break;
     }
 }
  
  
  
 function OnGUI()
 {
     GUI.depth = guiDepth;
  
     if (splashLogo != null)
     {
         GUI.color = Color(GUI.color.r, GUI.color.g, GUI.color.b, Mathf.Clamp01(alpha));
         GUI.DrawTexture(splashLogoPos, splashLogo);
  
             if (alpha > 1.0)
             {
                 status = FadeStatus.FadeWaiting;
                 timeFadingInFinished = Time.time;
                 alpha = 1.0;
  
                 if (splashType == SplashType.LoadNextLevelThenFadeOut)
                 {
                     oldCam.depth = -1000;
                     loadingNextLevel = true;
  
                     if ((Application.levelCount >= 1) && (levelToLoad != ""))
                     {
                         Application.LoadLevel(levelToLoad);
                     }
                 }
             }
  
             if (alpha < 0.0)
             {
                 if (splashType == SplashType.FadeOutThenLoadNextLevel)
                 {
                     if ((Application.levelCount >= 1) && (levelToLoad != ""))
                     {
                         Application.LoadLevel(levelToLoad);
                     }
                 }
  
                 else
                 {
                     Destroy(oldCamGO);
                 }
             }
     }
 }
  
  
  
 function OnLevelWasLoaded(lvlIdx : int)
 {
     if (loadingNextLevel)
     {
         Destroy(oldCam);
     }
 }
  
  
 function OnDrawGizmos()
 {
     Gizmos.color = Color(1, 0, 0, 0.5);
     Gizmos.DrawCube(transform.position, Vector3(1, 1, 1));
 }
  
  
 function StartSplash()
 {
     status = FadeStatus.FadeIn;
 }
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 PlanetGaming · Nov 11, 2013 at 04:18 PM

I tried that script and it just goes to a bluescreen and freezes.

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

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

Related Questions

How to have multiple scenes concurrently runnning 3 Answers

Load AssetBundles and External Scenes dynamically 0 Answers

Not loading in Chrome 0 Answers

Help with reloading scene for endless runner 2 Answers

How to use one object selected from previous scene to the current scene ? 1 Answer


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