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 extrime · Feb 01, 2013 at 01:58 PM · loadlevelnext level

Next Level (Loadlevel)

Can anyone help me.I need script for next level when i click some object with FPC to go to next level. Sorry for bed English and tnx.

Comment
Add comment
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

3 Replies

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

Answer by numberkruncher · Feb 01, 2013 at 02:09 PM

You can load the next level using the following:

 Application.LoadLevel(Application.loadedLevel + 1);

Obviously you will need to perform bounds checking on the level index, but this is the general idea.

See: http://docs.unity3d.com/Documentation/ScriptReference/Application.LoadLevel.html

Comment
Add comment · Show 3 · 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 extrime · Feb 01, 2013 at 03:24 PM 0
Share

Iam beginner but i know how use Application.LoadLevel but i dont know how to make script when i click on some object-(Cube) to go to next level.

Something like this

if(click object)

 Application.LoadLevel("Next Level")


I tried this but when i click "space" from any place i go to next level.I want to make when you find object{Cube) and when you click "space" you go to Next Level.

function Update () {

 if (Input.Get$$anonymous$$ey ("space")) {

     Application.LoadLevel("Next Level");
 }

}

avatar image EwanMcLain · Aug 31, 2014 at 07:13 PM 0
Share

is this c#, js or boo?

avatar image isador34 · Aug 31, 2014 at 07:58 PM 0
Share

for all language.

avatar image
1

Answer by Mmmpies · Aug 31, 2014 at 07:36 PM

You could try this:

private void OnMouseDown() { Application.LoadLevel("Whatever level you want to load"); }

and attach the script to the object (drag and drop the script onto the GameObject).

Really though go on youtube and search out some tutorials, try the burgzerg tutorials for example as they talk you through a lot of different scripting and unity scenarios. There are lots of other tutorials out there as well, one of the major advantages to unity is the community.

You're also going to have to pick which programming language you're going to use. Personally I'd learn c# if you're starting out as it's faster, it's a bit more fussy though so for a noob (and not too long ago I was that noob) it can be harder. Still it's faster, and if you've got to learn it from scratch then why not go for the fastest.

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 Eco-Editor · May 17, 2017 at 10:24 AM

I know this is an old post, but I have a strange thing happening. When I load next level using:

         void Update()
     {

         if (Controller.GetHairTriggerDown())
         {
             if (collidingObject) //I added the item to the conditional
             {
             Application.LoadLevel (Application.loadedLevel + 1);

Because I use Htc Vive instead of the Mouse Click,. This only works from my first scene, and it doesn't let me go through scenes in chronological order, but if I use scene name:

 Application.LoadLevel ("Floor2");

It will send me to any scene I want.

Any ideal why this is happening?

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 Eco-Editor · May 17, 2017 at 11:04 AM 0
Share

I see my problem now. As I'm using unity 5 I should use this:

void Update()

{ if (Controller.GetHairTriggerDown()) { if (collidingObject) {
Scene$$anonymous$$anager.LoadScene("0", LoadScene$$anonymous$$ode.Single); But, how do I add a new scene in chronological order? Something like Application.loadedLevel + 1?
avatar image Eco-Editor · May 17, 2017 at 11:33 AM 0
Share

I've solved it!

Apparently didn't add the scene loaded script in the other scenes.

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

13 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

Related Questions

Load Level when i click on some object 2 Answers

Load Level on Collision 1 Answer

Next LEVEL Load Problem. 2 Answers

Collision To Next Level Is Not Working 1 Answer

Unity crash, no one is call the function but it show up to the party anyways 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