[Bug 4.3.0] IsLocallyControlled() returns false for client-controlled pawn in multiplayer

Hey guys,

So in my networking research, I started to encounter problems determining if a pawn was currently locally controlled or not. I have reduced the problem to a simple repro;

  1. Create a blank project in 4.3.0.

  2. Add a new code class that inherits from APawn.

  3. Override the BeginPlay method, and add the code from below this list.

  4. Add bReplicates = true; to the constructor.

  5. Create a new gamemode (in blueprints), and then select your new class as the default pawn.

  6. Run the game in the editor with 1 client connected to a dedicated server.

  7. Observe that the ‘Not locally controlled’ message appears twice, despite the pawn being controlled locally by the client.

    if (IsLocallyControlled())
    {
    GEngine->AddOnScreenDebugMessage(-1, 10.f, FColor::Green, TEXT(“Ship is locally controlled!”));
    }
    else if (!IsLocallyControlled())
    {
    GEngine->AddOnScreenDebugMessage(-1, 10.f, FColor::Blue, TEXT(“Ship is not locally controlled!”));
    }

Any insight would be appreciated.

Thanks.

Hi ,

Apologies for this one getting overlooked. We are going back through a lot of these posts now in order to resolve them.

Are you still experiencing this crash or did it get resolved for you in a newer release of the editor?

If it’s still an issue let me know and I can look into this further.

Thank you!

Hi ,

We have not heard back from you in a few days, so we are marking this post as Resolved for tracking purposes. If you are still experiencing the issue you reported, please respond to this message with additional information and we will offer further assistance.

Thank you.