Cast PlayerController to MyPlayerController is failed

When i want to cast the Player Controller (Get Player Controller) to My Player Controller all ways failed.Why?And how can i fix?

![124758-u55)rlm)m6n~zsm@7d~clr.png|714x218

Did you set up your custom player controller on the gamemode you are currently using?

I were set it, but it doesn’t work.

I tried it on my project and I was able to cast it. Maybe in your current level/world you’re still using the default gamemode?

Yes, i used the default gamemode,I tried to use the custom gamemode, and change the playercontroller, but it also not fix.

I created the project follow this vedio: Drag & Drop with UMG | 01 | Live Training | Unreal Engine - YouTube. In his project, cast is worked, but in my project ,is not work.

Setting up your own Gamemode for the world and setting up the player controller in the gamemode should work maybe there is something wrong with your setup.

124775-world+gamemode.png

Here is my settings.
alt text

![124763-65ks_p5oxpplm({wube]20w.png|741x236](upload://gEULk4cft8i7831T9qK4LW28Fwt.png)

![124764-nc3@~w1sa{1x@y}qjakrwa.png|893x609

The name of gamemode is GameIstance

Sorry I can’t seem to find out what is causing the error for you.

For me its working.

That’s ok. Thanks for read my question.

Oh,I found the causing of the issue, just do that change the PlayerController in the GameMode blueprint.
Like this:

![124766-l$~y3cr~12(4n{8v}]00@04.png|1920x1080](upload://6Ey4xjrj5DaDG8v9pupYaivP9kr.png)

Oh I thought that was the one you were doing, thats what I’m trying to tell you to do. :smiley: