Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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
1
Question by BriceMcphailTV · Aug 01, 2011 at 12:11 AM · timelevelsseconds

Loading A Level After 40 Seconds

I have a cut scene that is exactly 40 seconds long and I am a pretty good javascript coder, i was trying to make a javascript that would load level one after 40 seconds. this is the script i was using function Update () { yield WaitForSeconds(40.0); Application.LoadLevel("FourBloods (Level 1)"); }

but i just get an error that says Script Error coroutine and when i double click it to see what is wrong another error pops up that says null reference to an object and a buch of other stuff. can anyone help or give me a new script, make sure you tell me if the script is C#, Java, or Boo

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 shahes · Nov 10, 2014 at 12:07 AM 0
Share

How would you do this in C#?

2 Replies

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

Answer by Eric5h5 · Aug 01, 2011 at 12:40 AM

Update runs every frame; it can't be paused or interrupted, or made into a coroutine. Don't use Update unless you want something to happen every frame. Use Start instead, which can be a coroutine. (Incidentally, Unity doesn't use Java.)

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 BriceMcphailTV · Aug 01, 2011 at 12:53 AM 1
Share

Thank you so much, you just made my day (-: and by java i meant javascript i was just to lazy to write it but you just save me alot of work thanks dude (-:

avatar image
1

Answer by Statement · Aug 01, 2011 at 02:05 AM

UnityScript (.js):

 var level : String = "FourBloods (Level 1)";
 var delay : int = 40;
 
 Invoke("Load", delay);

 function Load() {
     Application.LoadLevel(level);
 }
Comment
Add comment · Show 2 · 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 BriceMcphailTV · Aug 02, 2011 at 01:27 AM 1
Share

thats okay, i already had an answer, the one above

avatar image mrcameron999 · Apr 21, 2013 at 09:02 PM 0
Share

were do i put this script ?

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

Jump, fall, and after determined time it's able to jump again. 2 Answers

make an event occur after so many seconds? 1 Answer

New Level (Scene) after Enemies are gone 1 Answer

The name 'Joystick' does not denote a valid type ('not found') 2 Answers

when i click the GUI button it doesnt load the level 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