How to switch between gamemode

I am trying to switch between two game mode while running the game. I am using widget blueprint so that first it will switch to stationary camera and when player click the button in UI it will switch to “Firstpersoncharacter”. So i have two game mode to switch between. thanks in advance

You need to Open a new map to switch GameMode, the question is if that is necessary in your case. The GameMode already have a Spectator mode and a InProgress mode where the Character will get spawned if DelayedStart is checked.

With a GameMode set to “DelayedStart” It will start in state “WaitingToStart” using the Spectator Class. When you call “StartMatch” the game state changes to “InProgress” and the “Default Pawn Class” is spawned.

As GarnetP57 points out, your solution doesn’t require a different gamemode but rather switching camera’s and have different widgets loaded for them (Spectator Camera with a Spawn widget, then In Game with your full HUD). Possess a spectator pawn then possess the main character when ingame.