Hi Everyone,
I made a little game , endless runner type. The game run perfectly.
The problem appeared when i make the main menu.
When i try the game by hitting “Play” button from Unreal Engine (even if i hit “Standalone Game”) , the menu pop up. But in background the game start runing. I even can control my character by hitting “A,D” keys.
What can i do to prevent this ?
Note:
1.My character is moving with a “Event Tick”.
2.I already made a new level , and i deleted “Player Start” , but character still appear.
It may be because your GameMode has a pawn already set, so you’ll need to clear it and possess the specified character when the games starts.
make a new map called MainMenu
in the MainMenu level blueprint create your main menu widget there
When you click play, bind the play button from there have it open the starting level map using the open map node
you pawn will still probably spawn in the new map but it wont really matter.
otherwise you’re gonna have to probably make a custom player controller as a child of player controller. Set your game mode to use the custom one. The custom player controller start newly each map, it doesnt carry over from previous. You can use this to spawn player pawn (and then POSSESS the spawned pawn) pawns wherever you want in the level. You could even have it check the current map name on begin play and if it doesnt equal your first level name, then dont spawn anything. As the other answer states, make the default pawn class NONE in the game mode as you wont use it if you manually spawn.