Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
302 views
in Technique[技术] by (71.8m points)

c# - How can I restart my game when game over?

I am trying to make a 3d flappy bird game in unity and I can not figure out how to restart the game when the bird hits a Colum. I'm doing it in C#.

Thanks

question from:https://stackoverflow.com/questions/65599390/how-can-i-restart-my-game-when-game-over

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

You can restart the game by just load again the game scene

SceneManager.LoadScene("game_scene");

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...