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 sacajawhoohoo · Aug 07, 2013 at 04:56 AM · error

Script is not working at all

I had this "fixed" in another qustion, but the fix still didnt work and no one seems to be answering it anymore. so here is the script that i was given

 if (Input.GetKeyDown(KeyCode.esc))
 {
 //Load Game
 Application.LoadLevel("2");
 }
Comment
Add comment · Show 16
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 clunk47 · Aug 07, 2013 at 05:00 AM 0
Share

Check the console for errors or warnings. Your question is not specific. If there is no level with the name "2", as a string, it will not load. If you're trying to load level 2, which is the index of the level, don't use the index as a string..

 Application.LoadLevel(2);

Hit Ctrl + Alt + B to bring up build settings, make sure the level is added.

avatar image sacajawhoohoo clunk47 · Aug 07, 2013 at 05:07 AM 0
Share

Well Ive tried both the levels real name and the level index as well and it still does not work, the level has been added i made sure of that, and no other scripts use that key or level.

avatar image superluigi clunk47 · Aug 07, 2013 at 05:29 AM 0
Share

sorry I cant test this for you I am writing this from the wiiU but you have to put "" inside the (). Try changing the key to something other than esc, also try using Input.Get$$anonymous$$ey("esc"), or try using a box trigger to load the level when ur characte enters it. These are all simple mistakes. I don't know whether you are a master coder, a beginner, or something in between so I hope I didn't offend you with stupid suggestions

avatar image sacajawhoohoo clunk47 · Aug 07, 2013 at 07:15 AM 1
Share

jesus how?

Show more comments

2 Replies

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

Answer by superluigi · Aug 07, 2013 at 07:17 AM

 function Update()
 {
     if(Input.GetKey("escape"))
     {
         Application.LoadLevel(2);
     }
 }
Comment
Add comment · Show 5 · 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 sacajawhoohoo · Aug 07, 2013 at 07:18 AM 0
Share

thank you alot! but in a straight line like that it is a bit confusing

avatar image sacajawhoohoo · Aug 07, 2013 at 07:25 AM 0
Share

so im sorry again, im just really confused :( what needs to be in update? just the script? and i cant change "Load" to Esc? or Tab?

avatar image superluigi · Aug 07, 2013 at 07:28 AM 1
Share

that works guaranteed tested it and everything. If it's right please thumbs up and mark as correct, I've never had a correct answer before. Well I have I've just never gotten credit for it.

avatar image sacajawhoohoo · Aug 07, 2013 at 07:34 AM 0
Share

I had to change "2" to "Pause menu" but it works! thank you for helping smooches on the cheek

avatar image superluigi · Aug 07, 2013 at 07:35 AM 0
Share

check it out I accidently had "2" thats wrong its just 2 no "" needed. "" is for a name of something but if its just a level# in the build settings just put the number inside the ().

avatar image
0

Answer by bubzy · Aug 07, 2013 at 06:11 AM

 KeyCode.Escape
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 sacajawhoohoo · Aug 07, 2013 at 06:36 AM 0
Share

it did not work either, i do appritiate the help though

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

17 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 avatar image avatar image avatar image avatar image

Related Questions

Multiple Cars not working 1 Answer

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

Contunuing from old scene 1 Answer

unknown identifer explosion problem 2 Answers

No appropriate version of 'UnityEngine.AudioSource.Play' for the argument list '(System.Type)' was found. 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