# Changing GameMode when loading new sublevel

**URL:** <https://forums.unrealengine.com/t/changing-gamemode-when-loading-new-sublevel/322211>\
**Category:** World Creation\
**Tags:** gamemode, sublevel, unreal-engine, streaming, level, CPP, question\
**Created:** [June 18, 2015, 4:10am UTC](https://forums.unrealengine.com/t/changing-gamemode-when-loading-new-sublevel/322211 "2015-06-18T04:10:12Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kondoriano\_1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Kondoriano\_1](https://forums.unrealengine.com/u/Kondoriano_1)\
**Post date:** [June 18, 2015, 4:10am UTC](https://forums.unrealengine.com/t/changing-gamemode-when-loading-new-sublevel/322211/1 "2015-06-18T04:10:12Z")

</div>

Hello,

I am having issues having my game load a different gamemode when loading a new sublevel. I looked at as much documentations and tutorials as I could however I haven’t been able to find an answer.

I have created a new gamemode the following way

```
UCLASS()
class TESTGAME_API ABkInvadersGameMode : public AGameMode
{
	GENERATED_BODY()

		virtual void Tick(float DeltaSeconds) override;
public:

	ABkInvadersGameMode(const class FObjectInitializer& PCIP);
	
	UPROPERTY(EditDefaultsOnly, BluePrintReadWrite, Category = "Game Rules")
	int32 numEnemies;
};

```

All the cpp does is the following

```
ABkInvadersGameMode::ABkInvadersGameMode(const class FObjectInitializer& PCIP)
	:Super(PCIP)
{
	// default numEnemies
	numEnemies = 1;
}

void ABkInvadersGameMode::Tick(float DeltaSeconds)
{
	int i = 0;
	i++;

}

```

After doing this I opened one of my sublevels that I load via a blueprint using load stream level

 ![46808-load.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/8/f/a/8fa2e40e98875e06640cc86d8b08f34cf3bf5fe1.png)

and set my gamemode level override to my newly created gamemode

![46809-gamemodesetting.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/4/1/8/418f818ca43717395ea2927199adf05b399e17ca.png)

However when i set a breakpoint in my gamemode, the constructor gets called as soon as the game starts, not when the gamemode is loaded and the Tick function never gets called.

I’ve tried looking as hard as I could and i am wondering: Did I setup something wrong? (probably)  
does GameMode override not work with sublevels and or streaming?  
Should I be doing this differently?

Thanks for the help! 🙂

---

<div class="post-metadata">

**Author:** ![MiniTurtle](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@MiniTurtle](https://forums.unrealengine.com/u/MiniTurtle)\
**Post date:** [June 25, 2015, 3:50am UTC](https://forums.unrealengine.com/t/changing-gamemode-when-loading-new-sublevel/322211/2 "2015-06-25T03:50:57Z")

</div>

You have to use OpenLevel. Otherwise you are loading the level and merging with the existing level (you can’t have 2 gamemodes).

More info about level streaming here [https://wiki.unrealengine.com/Blueprint\_Manual\_Level\_Streaming](https://wiki.unrealengine.com/Blueprint_Manual_Level_Streaming)

If you would like to change game mode with LoadStreamLevel you have to do it manually.

P.S. You forgot Super::Tick(DeltaSeconds);

---

<div class="post-metadata">

**Author:** ![Kondoriano\_1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Kondoriano\_1](https://forums.unrealengine.com/u/Kondoriano_1)\
**Post date:** [July 1, 2015, 3:55am UTC](https://forums.unrealengine.com/t/changing-gamemode-when-loading-new-sublevel/322211/3 "2015-07-01T03:55:28Z")

</div>

Thanks!! 🙂

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_d4efcd70](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_d4efcd70](https://forums.unrealengine.com/u/anonymous_user_d4efcd70)\
**Post date:** [November 19, 2016, 4:35am UTC](https://forums.unrealengine.com/t/changing-gamemode-when-loading-new-sublevel/322211/4 "2016-11-19T04:35:07Z")

</div>

How can I change the gamemode manually?

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_76df31c4](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_76df31c4](https://forums.unrealengine.com/u/anonymous_user_76df31c4)\
**Post date:** [June 30, 2017, 2:43pm UTC](https://forums.unrealengine.com/t/changing-gamemode-when-loading-new-sublevel/322211/5 "2017-06-30T14:43:29Z")

</div>

I too need to know how can I change the game mode manually??

---

<div class="post-metadata">

**Author:** ![TornadoStorm](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@TornadoStorm](https://forums.unrealengine.com/u/TornadoStorm)\
**Post date:** [December 5, 2017, 9:33am UTC](https://forums.unrealengine.com/t/changing-gamemode-when-loading-new-sublevel/322211/6 "2017-12-05T09:33:49Z")

</div>

Me too! I also need to know how to change the gamemode manually. Do I simply spawn a gamemode blueprint or something?
