4.12 Player Controller not being assigned properly

  • Create new template
  • Set simple print PlayerController
  • Set players to more than 1
  • Test
  • It Works
  • Create new PlayerController
  • Assign in Project Settings
  • Save, restart project
  • Test again
  • It displays the same PlayerController

Now, you could think its just cosmethic but further testings shows they are actually sharing the same PC. in my main project i tried a View Target with Blend, and both players switched target. thank god i still have a not so old 4.11 backup, did the same test, as expected, it works fine. migrated it to 4.12, doesnt works. picked the stock PController, it works.

So either im missing something or what changed? days ago i had another problem with networking replication where i tried (by mistake) assign a class to a child actor when it already had it assigned, the whole engine crashed, pointing at NameTypes.h (i think that was the name of the file), saying that 2 objects had the same path but different names. couldnt reproduce the bug on a clean template.

Further details can be added tomorrow, spent almost one whole day trying to understand why my project is not working, and its because the engine is not even assigning the controllers properly.

Tested on the master branch, tested using c++ player controller as well. it displays the same player controller, contrary to using the stock controller.

Hi jblaswu,

I got the same problem on 4.12, and i got these problem in early version too… it seems GameMode class can not save properties correctly. while waiting the official fix, you can fix it by force set default values in cpp code.

  • create a c++ project

  • set PlayerControllerClass in construct function like the code below. the MyController is a Blueprint class created in editor.

    AMyProject3GameMode::AMyProject3GameMode()
    {
    // set default pawn class to our Blueprinted character
    static ConstructorHelpers::FClassFinder PlayerPawnBPClass(TEXT("/Game/ThirdPersonCPP/Blueprints/ThirdPersonCharacter"));
    if (PlayerPawnBPClass.Class != NULL)
    {
    DefaultPawnClass = PlayerPawnBPClass.Class;
    }
    static ConstructorHelpers::FClassFinder TheControllerClass(TEXT("/Game/ThirdPersonCPP/Blueprints/MyController"));
    PlayerControllerClass = TheControllerClass.Class;
    }

Cheers,
Omega

thank you so much for this. unfortunately, if i start using a c++ Gamemode i would need to try and migrate all the other functions. but will try to do so, even if i dont feel that comfortable with c++, thanks!

Any word on this being fixed? I am using 4.12.3 and still having this problem

I thought I’m the only one facing this issue. I am facing this as well. When returning PlayerController index 0 on client it seems to be getting a wrongly named controller.

I’m beginning to think it’s an issue in naming. I’m using custom PC as well.
When looping through all controller in server it seems that i’m getting

PlayerController <— server uses this
PlayerController1 <–client uses this

but client’s PlayerController(0) is only showing PlayerController instead of PlayerController1

Perhaps the object numbering starts from zero on client side? I can’t imagine how much code would break if the client keeps referring to the wrong controller.

Sadly no official explanation (surprise?) but it seems its just a display issue. Very confusing (im not totally sure how much it is indeed broken) and i dont have my project on multiplayer anymore (to avoid this poorly documented features)