# How to Reset / Restart a game

**URL:** <https://forums.unrealengine.com/t/how-to-reset-restart-a-game/446117>\
**Category:** World Creation\
**Tags:** reset, restart, open-level, unreal-engine, Shipping, question\
**Created:** [March 27, 2019, 4:12pm UTC](https://forums.unrealengine.com/t/how-to-reset-restart-a-game/446117 "2019-03-27T16:12:50Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Colder347](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Colder347](https://forums.unrealengine.com/u/Colder347)\
**Post date:** [March 27, 2019, 4:12pm UTC](https://forums.unrealengine.com/t/how-to-reset-restart-a-game/446117/1 "2019-03-27T16:12:50Z")

</div>

Hi everyone, I’ve been trying things for days, but I can’t solve my problem and I’m a little bit desperate now.

I’m making an endless runner for android, after the player dies I want the game to be reset so the player can play the game again.

Nodes that I used to achieve this goal:

Open Level: Works perfectly in the editor and when I package it for development, It stops working when I package the game for Distribution (Shipping). (Like the node is not there?) ‘Cook everything in the project content directory’ is set to true.

Execute console command: Works perfectly in the editor and when I package it for development but ofc this node will be removed when I package it for Distribution.

Restart game: Restart game needs a ‘Game Mode Object Reference’ and when I take the node ‘get game mode’ it returns a ‘Game Mode Base Object Reference’ so I can’t connect that one?

Maybe there is someone with a different idea to achieve this goal or can help me with the problem i have with ‘Open level’ and ‘Restart game’.

I really hope that someone can help me!

---

<div class="post-metadata">

**Author:** ![BenVlodgi](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/benvlodgi/32/1194567_2.png) [@BenVlodgi](https://forums.unrealengine.com/u/BenVlodgi)\
**Post date:** [March 27, 2019, 5:14pm UTC](https://forums.unrealengine.com/t/how-to-reset-restart-a-game/446117/2 "2019-03-27T17:14:11Z")

</div>

Ensure your GameMode’s parent class is [`GameMode`](https://docs.unrealengine.com/4.27/en-US/API/Runtime/Engine/GameFramework/AGameMode/) not [`GameModeBase`](https://docs.unrealengine.com/4.27/en-US/API/Runtime/Engine/GameFramework/AGameModeBase/).

![272600-ue-answerpic53a.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/9/9/1/991259326b85a0231da9c3dca1903ed9c492f5c4.png)

Then you can cast the current game mode base successfully to [`GameMode`](https://docs.unrealengine.com/4.27/en-US/API/Runtime/Engine/GameFramework/AGameMode/) and call [`RestartGame`](https://docs.unrealengine.com/5.0/en-US/BlueprintAPI/Game/RestartGame/).

![272601-ue-answerpic53b.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/a/6/9/a693afbf90c355388c8ea1e1c5b2b3ae83daa9f5.png)

---

<div class="post-metadata">

**Author:** ![Colder347](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Colder347](https://forums.unrealengine.com/u/Colder347)\
**Post date:** [March 27, 2019, 7:35pm UTC](https://forums.unrealengine.com/t/how-to-reset-restart-a-game/446117/3 "2019-03-27T19:35:30Z")

</div>

Thx BenVlodgi, you are a hero!  
Restart game is now working and it has solved my problem.

---

<div class="post-metadata">

**Author:** ![BenVlodgi](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/benvlodgi/32/1194567_2.png) [@BenVlodgi](https://forums.unrealengine.com/u/BenVlodgi)\
**Post date:** [March 28, 2019, 1:32pm UTC](https://forums.unrealengine.com/t/how-to-reset-restart-a-game/446117/4 "2019-03-28T13:32:00Z")

</div>

Glad that helped! 🙂

---

<div class="post-metadata">

**Author:** ![araz01](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/araz01/32/1028814_2.png) [@araz01](https://forums.unrealengine.com/u/araz01)\
**Post date:** [May 16, 2021, 3:40pm UTC](https://forums.unrealengine.com/t/how-to-reset-restart-a-game/446117/5 "2021-05-16T15:40:20Z")

</div>

Or Use “Get Current Level Name” IN the Place Of “Open Level” (Name Area) And You Can Restart Every Level Without Having To Change Nothing! Every Level Will Have Its Own Restart, AWESOME!

---

<div class="post-metadata">

**Author:** ![GenkiB](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@GenkiB](https://forums.unrealengine.com/u/GenkiB)\
**Post date:** [May 5, 2022, 9:00am UTC](https://forums.unrealengine.com/t/how-to-reset-restart-a-game/446117/6 "2022-05-05T09:00:50Z")

</div>

This worked for me too, thanks!

---

<div class="post-metadata">

**Author:** ![AndrewFord](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/andrewford/32/755855_2.png) [@AndrewFord](https://forums.unrealengine.com/u/AndrewFord)\
**Post date:** [January 21, 2024, 7:02pm UTC](https://forums.unrealengine.com/t/how-to-reset-restart-a-game/446117/7 "2024-01-21T19:02:53Z")

</div>

You can also create a function library with this function to use the selected gamemode when restarting:

 ![Restart](https://d3kjluh73b9h9o.cloudfront.net/original/4X/d/3/3/d332adb5401dd04c28dbb7a2e06bd26503a84094.png)

---

<div class="post-metadata">

**Author:** ![houxk76houxk76](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@houxk76houxk76](https://forums.unrealengine.com/u/houxk76houxk76)\
**Post date:** [November 10, 2024, 10:06pm UTC](https://forums.unrealengine.com/t/how-to-reset-restart-a-game/446117/8 "2024-11-10T22:06:13Z")

</div>

Thanks, solved my problem
