Unity - How to Reset / Reload Scene with C# (Restart Game Button Click, 2021) | Easy Tutorial

preview_player
Показать описание
An easy way to reset the current scene with a click of a button in Unity, using C# programming. This can also serve as a "retry" button, if hypothetically, you were coding a game and want to make the player restart their progress if they lose the game. This is an update to my December 2020 video with less filler and is more straight to the point. Hopefully this video helped!

SKYPE: rafa.v35 #linuxtutorialvideos #ubuntututorialvideos #ubuntulearningtutorial #centostutorialvideos #centosadministrationtutorial #learninghowtoprogramgames #learningunityprogramming #simplecodingtutorial #easycodingtutorials #veryeasycodingtutorials #unityeasygametutorial
Рекомендации по теме
Комментарии
Автор

Thank you bro, i wish i saw the tutorial earlier bc i spent 2h in this, but with this tutorial it just took 5 min

codabex
Автор

Thank you! That was a very great tutorial for a person like me that is just starting out

grizzlyjer
Автор

very simple and good tutorial, thanks!

Poiter
Автор

IF YOUR GAME IS FROZEN THEN:

public void ResetScene()
{

print("Scene restarted");
Time.timeScale = 1f;
}

the timescale sets the time to 1 so it isn't frozen, 2 means 2 times and it probably is set to 0 which is why it’s frozen

dakshrokadia_MTB
Автор

great video Rafael, simple to follow and works perfectly. thanks.

PaulLeBlancu
Автор

Wow dude. You made that so simple. Thanks.

thedave
Автор

Thanks alot . YOU are a GOD(Life Saver)

sifisosamson
Автор

Ok great Tutorial its working Thx but how do i make it so it only shows up when i die?

LuffyGo
Автор

Hello. It does not function. It always pauses the scene and then continues shortly after the pause when I click the button where I added the function

MegaSenkel
Автор

amazing tutorial, thank you very much!

heppy_dogs
Автор

When I hit reset it makes everything gltichy, like all the textures are gone and stuff

Goofy_Music
Автор

why am I getting "error CS1519: Invalid token '(' in class, record, struct, or interface member declaration" when I try to run your code in a function?

ManmadeHorrorsBeyond
Автор

Question :
when resetting the scene the shadows of the game become hard only instead of hard and soft how can I stop this?

dakshrokadia_MTB
Автор

@xxRafael Productions - Rafael Vicuna, thanks. I was following a tutorial and could not find the GameReset() function. After a few minutes of your video it occurred that I did not finish the script to a public void GameReset() line.

OmeedNOuhadi
Автор

if people are getting confused he is using the main camrea as a script holder for the code

jabba
Автор

Would using a keystroke for this work as well?

koenemanse
Автор

hi, When the scene is reloaded, it picks up where it left off. The scene does not start over :(

tolgakyz
Автор

This approach fully reloads the scene, resetting all objects, scripts, and variables. What Happens:

The scene starts over completely as it did when first loaded.
Any unsaved progress is discarded.

sawlekk
Автор

when i die nothing happens not showing restart scene

spooky_
Автор

Nice Bro, easy to learn for newbe like me.

bondragame
visit shbcf.ru