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 James73 · Sep 29, 2012 at 12:16 AM · javascriptscenevariablesloadlevelonmouseup

How do I load a scence upon clicking on and object?

I have tried to write a very simple script but it will not work:


var Level: 0 ;

function OnMouseUp () { Application.LoadLevel(Level); }


Perhaps you can help me fix my script or give me another one. Thank You!

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 James73 · Sep 29, 2012 at 06:53 AM 0
Share

Just to be clear - I'm giving this script to the object (3D Text). Should it go to the Controller ins$$anonymous$$d?

1 Reply

· Add your reply
  • Sort: 
avatar image
2

Answer by Sundar · Sep 29, 2012 at 04:20 PM

Did you add your level 0 into your build settings? If not

  1. File->BuildSettings

  2. Drag and drop your level 0 scene into "Scenes In Build" or click "Add Current" if your are currently in level 0 in editor.

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 James73 · Sep 30, 2012 at 10:13 PM 0
Share

Yes I did but it still does nothing. =[

avatar image James73 · Sep 30, 2012 at 10:28 PM 0
Share

O$$anonymous$$G! LOL! I had the object behind a plane just didn't realize because it was 3D text. But I still can't get the variable to show up, therefore i cant change it to the level causing more bugs. -.-

avatar image Sundar · Oct 01, 2012 at 02:43 AM 1
Share

I see in your code var level:0 is it not level = 0 ?

avatar image James73 · Oct 01, 2012 at 02:50 AM 0
Share

oh - yea I'm new to javascript. TY

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

10 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

Related Questions

Can a script be loaded to a next scene? 3 Answers

Space Invaders style game bug. 1 Answer

Make a global variable that can be accessed in different scenes 2 Answers

Teleporting from one scene to another and back again with the same player gameobject 1 Answer

How to make GUI text disappear after a few seconds? 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