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 benjimazza · Oct 26, 2011 at 03:42 PM · animationload

Trouble with Load Level

hello :),,, i have wrote a code out but it doent work,, im not a very good coder so i could tell what was wrong with it This is the code

 function Update () 
 {
   if(Application.WaitForSeconds == 10)
   {
     Application.LoadLevel("Kino_Dar_Zona");
   }    
 }

What i wanted was for my splash screen to wait 10 seconds and then load a level automaticly,,, sorry for the stupid code that dosent make sence but im learning still so im just testing things out.. if anybody could help me fix this code or tell me another code that would work then that would be great

Thanks

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 TinkerinThinker · Dec 17, 2013 at 04:24 PM 0
Share

I know this wasn't actually part of your question, but I think it's worth noting that you might be missing the point of splash screens. Users don't want to wait 10 seconds if they can help it! You should begin loading the level and display a splash screen for the time it takes to do the loading. That way the user is less likely to become bored while waiting for the next level.

Of course I realize that there may be some important information that you are showing in the splash screen or there may be some other important reason for making the user wait 10 seconds - I just felt the need to make this point for potential viewers of this question.

2 Replies

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

Answer by GoSuNeem · Oct 29, 2011 at 07:39 AM

You can also add something in the Awake() or Start()

http://unity3d.com/support/documentation/ScriptReference/MonoBehaviour.Invoke.html Invokes are pretty sweet ;]

function Awake() { Invoke("LoadNewScene", 10); }

function LoadNewScene() { Application.LoadLevel("Kino_Dar_Zona"); }

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 benjimazza · Oct 31, 2011 at 05:18 PM 0
Share

This Worked nicely, :D Thank you so much :) and thanks for this link it will help me with loads more things, I shouldn't have to ask as much questions now. :)

Thanks again.

avatar image
0

Answer by Graham-Dunnett · Oct 26, 2011 at 03:49 PM

Try this:

 function Update () 
 {
   yield WaitForSeconds (10);
   Application.LoadLevel("Kino_Dar_Zona");
 }
Comment
Add comment · Show 4 · 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 benjimazza · Oct 26, 2011 at 07:12 PM 0
Share

sadly it doesnt work :( it says in the debug box Script error: Update() can not be a coroutine. Any idea's ??

avatar image puppeteer · Oct 26, 2011 at 07:52 PM 0
Share

Yes, just don't put it in update.

Like Graham's code but not in the Update() function.

 function NewLevel() 
 {
   yield WaitForSeconds (10);
   Application.LoadLevel("$$anonymous$$ino_Dar_Zona");
 }
avatar image benjimazza · Oct 28, 2011 at 05:46 PM 0
Share

still didnt work

avatar image GoSuNeem · Oct 30, 2011 at 06:09 AM 0
Share

Like I said, try...

function Awake() { Invoke("LoadNewScene", 10); }

function LoadNewScene() { Application.LoadLevel("$$anonymous$$ino_Dar_Zona"); }

All this would do is that when the code loads up it'll wait 10 seconds then it'll run the "LoadNewScene" function. which is just "Application.LoadLevel("$$anonymous$$ino_Dar_Zona");"

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

6 People are following this question.

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

Related Questions

How to attach Animation to other objects in script? 1 Answer

Attack Animation Trigger 1 Answer

Could anyone help me with this weapon script? 1 Answer

Walking Motion 1 Answer

Create a Sprite Animation Clip in Code 3 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