Custom Player Controller Event Begin Play never called

Hello!
I’ve created my own custom player controller. In it I do the following.
Capture.JPG
So the string shown should be printed when the game starts. This is named Capture.JPG
I have my character’s blueprint dragged onto the map and I’m able to control it. (It is possessed)

Next in my game mode I have this set:


It is named Capture.JPG .

And in my project settings I have this:

You can see the Game mode and the Player Controller class are both set. However when I run the game, the text ‘CustomPlayerController exists’ does not print.

Also, when I attempt to do this:

(This is bound to the tab key) When I press the tab key and this fires, the Cast To CustomPlayerController fails and prints the text “fail to cast”

Any idea what I’m doing wrong here? I’m hoping it’s just something simple that I’ve missed!

Never mind it just started working for no reason at all. I literally changed nothing, I was too busing smashing my skull into a wall from pure anger.

2 Likes

In the past - I have had issues changing the Selected Game Mode settings (like Default Player Controller) on newly created maps. After restarting editor - the changes worked.

Also - it is sometimes useful to directly print the DisplayName of GetPlayerController just to see what class it is.

I remember doing this and it was printing the default class. Which makes sense why it would error because it was trying to access some variables that only existed on the custom player controller

Thank you!

Mine runs Tick but not binge play … did you just restart it or what ?

My Problem was caused by GameMode and Game state … both of them need to be either base or non you can’t mix

1 Like