When hitting “play” in the editor, the Event Begin Play event no longer fires on PlayerController, GameMode, or Pawn classes configured for the level. (Haven’t checked other classes.)
Reproduction path:
Start a new project as empty blueprint.
Create BP_GameMode as gamemode
Create BP_PlayerController as playercontroller, make it print in event begin play
Configure the BP_PlayerController as the player controller in the gamemode
Configure the BP_GameMode as the default game mode in project settings and build/save
At this point, it will still fire the event begin play
Create BP_PlayerCameraManager as playercameramanager
Assign BP_PlayerCameraManager as the camera manager for BP_PlayerController and build/save
At this point, you will not see the event begin play fire
And, here comes the super curious bit:
Re-set the player camera manager back to None in BP_PlayerController
Delete the BP_PlayerCameraManager class from the project
Save/build
It still doesn’t get the begin play events
It’s like something in assigning a custom player camera manager permanently messes up the project. Which is … I have a hard time explaining how that could even happen.
FWIW, I tried stepping through play-in-editor in Visual Studio (pulling source for release 4.15.0 from GitHub) and there’s no obvious exception getting thrown. The ReceiveBeginPlay() function gets called on each actor. However, when the PlayerCameraManager blueprint is created, the blueprint events stop firing. Bizarre.
I would suspect that perhaps something in the blueprint-ization of PlayerCameraManager is wrong, and ends up invalidating / corrupting the blueprint event dispatch? That’s kind-of vague, I know, but that’s about as far as I can get without diving way deeper into the implementation internals than I’m able to at this time.
,
Thanks for the answer.
Yes, I can reproduce this in a clean project – just did when writing down the steps.
I’m using a GameMode subclass IIRC.
I’m going to try this on my second machine and see if it still happens.
And if it does, I’ll see if I can get ShadowPlay to record the whole thing.
Normally, in a totally new project, I make the gamemode, player pawn, and controller. I set the gamemmode to use pawn/controller, then I set the project to use my gamemode. I hit play, I spawn, all is well! I’ve done this millions of times by now.
Your issue seems to be a conflict between having a gamemode base and then not using a GameState base, not using the same types can cause a conflict where the event begin play will not fire. I was able to achieve the results of your issue when I had a GameMode base and then made a custom GameState that was not a GameState base.
Gamemode and GameState without the bases are designed to behave like a multiplayer match, which means that if the two don’t match up (ie the gamemode is gamemode base, and the other is gamestate) The game will wait for the “multiplayer match to start” before running an event begin play match.