How to avoid engine destroy the character when player leave or get disconnect

Hello.

With BP, i trying keep the character in the map (Multiplayer) if player leave or get disconnect or network error. By default get destroyer.

I suppose i must “un posses the character” but how detect the player leave or get disconnect before the engine destroy it.

I create a AH topic too: How to avoid engine destroy the character when player leave or get disconnect - Multiplayer & Networking - Unreal Engine Forums

found that “OnEndViewTarget” in the Player Character its called before destroy.

For check i made a function (served side) for un-possess the pawn, called with a key, that work, press the key and then quit or alt+f4 and character not get destroyer

The problem its i call the same function from “OnEndViewTarget” for un posses and if “Quit Game” or Alt+F4, OnEndViewTarget its called but the pawn still got destroyed.

grrr the engine must have something easy for keep the character without destroy on the map if some problem occurs, nobody known?

On destroyed -> spawn/show dummy copy of me :wink:
I do that stupid thing and it works for my needs.

i consider that option and if the player reconnect just “give” that copy for posses but seems a “dirty” trick. hehe.

And in MP i think if after destroy->spawn others will notice.

I think the engine must have any mechanism for avoid that. Greatest part of MP games like DOTA, CS the player character isn’t destroyed on network error/disconnect and/or leave. Seems basic feature.

Anyway, its an alternative.

I you set game mode’s default pawn to none and spawn characters at start, then later possess maybe the character won’t be destroyed :confused:
If character is still destroyed under those circunstances that should be reported as a bad engine design and ask Epic to change that.

Clients already join my server as spectator, and then when all its ready i spawn the characters and then assign/possess characters->player controllers, all in the gamemode class.
:frowning:

i doubt its bad design, i think its only i not known how do it. if was a bug or bad design someone before must have this problem. I suppose someone create already a MP game that the player possess a car, a character shareable or persistent or other thing and want that thing not get destroyed if a remote client got disconnect/network error or user quit, that can break a MP game if that thing its supposed need be in game/round .

I search forums and AH and nobody have that problem. :confused:

This is interesting; then I don’t know how to solve it as well, hope someone come in and explain to us if there’s a solution for this. From my point of view controller shouldn’t auto destroy the pawn if it wasn’t spawned with controller already attached to it.

I create a post in AH for check if i have more luck about this topic here.

For reference the AH post: