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 /
  • Help Room /
avatar image
0
Question by Ampler Games · Jun 20, 2012 at 03:20 AM · reset

R key= reset

I'm not very good at scripting and i need to know how i would make the scene reset it self when I press the R button. HOW DO I DO THIS?

Comment
Add comment · Show 2
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 Ampler Games · Jun 20, 2012 at 03:52 AM 0
Share

Please Help!

avatar image koltonaugust · Jun 20, 2012 at 04:21 AM 0
Share

Wait, i forgot to add the setup of the script in my answer so just put that in the Update() function's braces. If you say create C# script it will set up the frame of it already, so just copy and paste! Once you do that, save and drag the script to an object in your scene.

3 Replies

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

Answer by djm · Jun 20, 2012 at 05:05 AM

 if(input.GetKeyDown(varKeyInput)
 {
  Application.LoadLevel (Level);
 }
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 djm · Jun 20, 2012 at 05:18 AM 1
Share

Either one of the above mentioned suggestions should work. With (var$$anonymous$$eyInput) you would have to go into your inspector window and add the "R" $$anonymous$$ey to the Inspector variable.

avatar image Ampler Games · Aug 22, 2012 at 03:55 AM 0
Share

Ok sweet it all work fine!

avatar image Owen-Reynolds · Jun 13, 2016 at 06:18 PM 1
Share

Yes, application.loadlevel is obsolete now. Just search for "unity load level" and you'll find the new way. This person is also being a little cutesy using var$$anonymous$$eyInput and assu$$anonymous$$g you know how to make it. But also, just look up "unity read keypress" and you'll find all you need.

The problem is, this is really those two Qs (reload a level, read a key) combined.

avatar image
4

Answer by koltonaugust · Jun 20, 2012 at 05:13 AM

Simply put

 if (Input.GetKeyDown(KeyCode.R))
      Application.LoadLevel("SceneTitle");
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 Joeman9832 · Aug 25, 2016 at 04:50 AM 0
Share

This will change the lighting it will make it so the things in the scene dont work anymore

avatar image
0

Answer by pappernabkin · Apr 10, 2017 at 05:48 PM

public Keycode ResetKey = Keycode.r; public string SceneName = "Input Scene"; //wrote this in the forum not mono so there may be some errors void Update(){ if(Input.GetKeyDown(ResetKey)){

Application.LoadLevel(SceneName); }

}

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

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

Resetting the level without changing variables 0 Answers

How to save progress? and not delete values on load 1 Answer

Scene Reset on HTC Vive Idle? 0 Answers

Resetting rotation of FPSController on collision. 0 Answers

Timer instantly sets to zero 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