Multicast causes clients to "unpossess" and if pawns they had are destroyed, crashes game

Just like question, Multicasting caused client to be fake ejected from its possession (player controller returned to its starting spawn position), and its pawn would still exist, and if destroyed, game crashed. It was called in same Exec path (through a custom event) after Server spawned and possessed a new pawn.

I got around it by changing event to be Owning Client.

Hi ScruffyHollywood,

Thanks for report! Can you post some images of your BP setup for relevant events so I can try to reproduce it here? I believe this is related to a known crash, but I’d like to be certain.

Please also copy information from Crash Reporter window after this crash occurs, including Machine ID, and paste it here. Your log from project’s Saved\Logs folder would also be useful. Thanks!

Sure, the “fake unpossession” seems to happen anytime a RELIABLE Multicast is performed. It’s called from Player Controller through a Run On Server event.

crash occurs when possessed pawn is destroyed. Crash logs. 3 I found, from folder, and Crash Reporter.[link text][2]

[link text][3]

Hm, I still can’t reproduce this. In your image, Custom Event isn’t Reliable… does it not crash if it’s not set to Reliable?

Can you reproduce this in a new project, or does it only happen in your current project? If you can make a small test project and upload it somewhere, I can take a look at it. Otherwise I’ll keep looking into it here and see what I can figure out.

Reliable = true is where it bugs. It seems to be any time I call a Reliable Multicast. And I’ll test a new project and I’ll copy log stuff later today when I get back to it.

I thought I reported this already. I guess I didn’t.

This is totally true and super annoying, although its true you shouldn’t be using multicast in player controllers anyway.

cause of this is because only local Player Controller exists on clients, networking layer is somehow interpreting multicast call as I believe a pc/playerstate swap, which is normally done when you log into a server and server wants to swap your local player controller with one it’ll provide for you (or something to that effect). Because payload data is fubar, best case you’ll unpossess and be in a bad state. Average case is a hard crash with debug info that makes no sense.

It has been present at least since June 1, 2015. https://twitter.com/MichaelAllar/status/605506060078608384

But fix is definitely “Run on Owning Client”

“I got around it by changing event to be Owning Client.”

This is infact correct and only solution. Clients only are aware of their own PlayerController and don’t have PlayerController objects for other players. Running a Multicast on a PlayerController causes bad things to happen because you’re telling all clients to run a function on something that technically doesn’t exist. Only Server is aware of all PlayerControllers.

Run on Owning Client will ensure clients don’t recieve function calls for PlayerControllers that don’t exist locally.

If you need a multicast, do it in Character or PlayerState or really any other object that will exist for everyone on everyone’s client.

Hey Allar,
Really glad to bump into your post as I was just having this problem in 4.10.1.

only reason I’m calling multicast in playercharacter is because I need both Server and Client to be able to move an object with mouse drag (despite Client not owning object). Does this mean I can (and should?) move all these logic into PlayerState and it would work?

Edit: Okay it does work better =p I’m just not sure if it’s right place to do so.

Thank you for your detailed answer Allar.

My client’s Player Controller got destroyed and recreated (On destroyed and On Begin Play Events both fired) whenever a multicast reached that Player Controller. (from a Client to a run on Server event to a multicast event - all on a player controller class).

This is super annoying and should be explained better. Or at least give a proper error message. Instead it simply destroys and creates a new Player Controller, which doesn’t make sense and breaks whole functionality along way.

I don’t use any pawns because it’s only a lobby level with UI only. Instead of creating pawns just to use multicast events, I chose to iterate over all player controller (on server → get all actor of type xyzPlayerController) and for each of them, I called a run on owning Client.

Still… It would be nice to see a error message or anything. Or maybe disallow multicast Events from Player Controller completely?

How can I check whether this Bug/Problem already got reported?

Again. Thanks for your comment. Would have annoyed me for a quite a few hours if it wasn’t for your comment.