Hi guys,
I’ve a bunch of methods running in Game Mode blueprint. When I run in editor, everything works fine. Then I made a build of the project. Few things I did before building the game.
Go to project settings and in Map Mode option, I specified my game mode.
For all the levels, I specified this game mode in world settings of each level.
I made a development build.
Here is the problem: The game mode is not running in the build. I found it after putting debug messages in the game mode blueprint which can be easily seen in the development build.
Did anyone encounter this problem ? What could be the possible solution ? Why this weird behaviour happening ?
What could be the reason, for this game mode not running in Build.
I found a solution. Its a strange trick so Unreal veterans please have a look. I saw the code inside my game mode blue print I run some code in Contruction script. Here is the screenshot.
Interestingly if I build(development build) the project. And run the standalone .exe file of the game I don’t see any of the debug messages in the build.
But if I run the same code in Event Begin Play of the game mode blueprint like below screenshot.
my understanding is that the construction script ONLY gets executed in the editor when you drag a blueprint into the level. Literally, it executes as you drag it into the level – to let you define logic to help alter the blueprint’s behavior depending on the objects around it in the level. So, if you spawn something in-game, the construction script is not run.
BeginPlay will run for all objects at the start of the level (if they already exist) or when they are first spawned in game.