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
0
Question by Vonnibles · May 14, 2010 at 06:04 AM · buildlevelloadlevel

Level changing and build issue

I've run into a bit of a snag with level changing.

In my Start Menu (Level 0), I use this script to make the 'Play' button go to an opening video (which is in the build settings as level 1)

if (GUI.Button( Rect( (Screen.width/2)-70, Screen.height -160, 140, 70), "Play"))
{
isLoading = true;
Application.LoadLevel(1);
}

When I click play in the editor, it goes to level 1 and plays the video. In my video is this code:

function Start(){
        guiTexture.texture.Play();
    }
    function Update(){
                if(!guiTexture.texture.isPlaying){
               Application.LoadLevel (2);
        }
    }

Which changes the level to my main level after the movie has played.

However, when build the game and test play it, clicking 'play' takes me immediately to my main level (2).

What am I doing wrong? Why does it work in the editor but not in the game?

ALSO:

I have a chain of levels set up to play to go from day to night cycles.

This is the code I use to test the levels will load in the right order.

function Start ()

{

yield WaitForSeconds (20);

Application.LoadLevel(4); }

It loads after 20 seconds, but it doesn't load level 4 - it loads level 0. I've tried using the title instead of number ( Application.LoadLevel("Night_2"); ) but this just loads the same level as the one I am in.

I am baffled.

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

2 Replies

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

Answer by Vonnibles · May 19, 2010 at 09:15 AM

Well I'm not sure what the problem was but the first was solved by re-importing the video files and the second issue vanished when I used a code to fade to an image, the the Next level.

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 Extrakun · May 14, 2010 at 08:08 AM

For your second problem, have you go to Build Settings and add your new level?

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 Vonnibles · May 14, 2010 at 10:39 AM 0
Share

Yeah, I've double checked. All levels are loaded into build settings. :(

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

No one has followed this question yet.

Related Questions

Distribute terrain in zones 3 Answers

Door that changes level on character collision script help? 1 Answer

How to save a scene that you randomly generated as a new level in your build settings? 1 Answer

Loading assets for a level from asset bundle 1 Answer

Score / Loading Level 2 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