# Reset player controller

**URL:** <https://forums.unrealengine.com/t/reset-player-controller/432214>\
**Category:** Blueprint\
**Tags:** reset, reset-to-default, unreal-engine, question, Blueprint\
**Created:** [August 22, 2018, 3:14pm UTC](https://forums.unrealengine.com/t/reset-player-controller/432214 "2018-08-22T15:14:51Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Cosmik-Debris](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Cosmik-Debris](https://forums.unrealengine.com/u/Cosmik-Debris)\
**Post date:** [August 22, 2018, 3:14pm UTC](https://forums.unrealengine.com/t/reset-player-controller/432214/1 "2018-08-22T15:14:51Z")

</div>

Normally, when loading a new level the player controller is reset to default. Is there a way to reset it manually? For example, between streaming levels where the persistent level doesn’t change, but you still want to reset/restart the controller to default state?

I tried destroying the controller but this seems to do nothing. Also I tried removing the player but the game crashed. Also restarting the player does nothing.

---

<div class="post-metadata">

**Author:** ![w0hoho](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@w0hoho](https://forums.unrealengine.com/u/w0hoho)\
**Post date:** [August 22, 2018, 9:15pm UTC](https://forums.unrealengine.com/t/reset-player-controller/432214/2 "2018-08-22T21:15:45Z")

</div>

I don’t know if this is what you are looking for but you can set different controllers for different levels on ‘world settings’.

---

<div class="post-metadata">

**Author:** ![Cosmik-Debris](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Cosmik-Debris](https://forums.unrealengine.com/u/Cosmik-Debris)\
**Post date:** [August 22, 2018, 10:04pm UTC](https://forums.unrealengine.com/t/reset-player-controller/432214/3 "2018-08-22T22:04:41Z")

</div>

I actually want to use the same player controller, but a different instance of it. So when I unload the streaming level I want to destroy the current player controller and create a new one OR reset the current one to it’s default state.

I managed to destroy it using C++ but this crashes the game.

---

<div class="post-metadata">

**Author:** ![Cosmik-Debris](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Cosmik-Debris](https://forums.unrealengine.com/u/Cosmik-Debris)\
**Post date:** [August 23, 2018, 10:51am UTC](https://forums.unrealengine.com/t/reset-player-controller/432214/4 "2018-08-23T10:51:12Z")

</div>

I found a solution:

[https://api.unrealengine.com/INT/API/Runtime/Engine/GameFramework/AGameModeBase/SwapPlayerControllers/index.html](https://api.unrealengine.com/INT/API/Runtime/Engine/GameFramework/AGameModeBase/SwapPlayerControllers/index.html)

I exposed it to BP like this:

```
void UTheBirdcageCPPFunctionLibrary::SwapPlayerController(APlayerController * OldPC, APlayerController * NewPC, AGameModeBase * GameMode)
{
GameMode->SwapPlayerControllers(OldPC, NewPC);

return;
}

```

Then spawn a new player controller with the ‘spawn actor from class’ node and perform this function on it.

---

<div class="post-metadata">

**Author:** ![mightyenigma](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@mightyenigma](https://forums.unrealengine.com/u/mightyenigma)\
**Post date:** [August 25, 2018, 6:04pm UTC](https://forums.unrealengine.com/t/reset-player-controller/432214/5 "2018-08-25T18:04:37Z")

</div>

there is a clunky way: GetClassDefaults function. You can copy all the values from that to the current playercontroller instance.

---

<div class="post-metadata">

**Author:** ![C64debug](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@C64debug](https://forums.unrealengine.com/u/C64debug)\
**Post date:** [October 18, 2022, 10:38am UTC](https://forums.unrealengine.com/t/reset-player-controller/432214/6 "2022-10-18T10:38:13Z")

</div>

Thanks for sharing! Where do you call this from / when?

---

<div class="post-metadata">

**Author:** ![Cosmik-Debris](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Cosmik-Debris](https://forums.unrealengine.com/u/Cosmik-Debris)\
**Post date:** [October 18, 2022, 10:58am UTC](https://forums.unrealengine.com/t/reset-player-controller/432214/7 "2022-10-18T10:58:29Z")

</div>

Called it just before or after streaming the new level, in the game mode.
