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?
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.
Answer by djm · Jun 20, 2012 at 05:05 AM
if(input.GetKeyDown(varKeyInput)
{
Application.LoadLevel (Level);
}
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.
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.
Answer by koltonaugust · Jun 20, 2012 at 05:13 AM
Simply put
if (Input.GetKeyDown(KeyCode.R))
Application.LoadLevel("SceneTitle");
This will change the lighting it will make it so the things in the scene dont work anymore
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); }
}
Your answer
Follow this Question
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