Actors are being destroyed at the client side without them being destroyed at the server side

Replicated actors are getting destroyed at the client side, even though they are very much alive at the server side.

When any of the Replicated actors calls a multicast method at the server side, at the client side that actor is getting created and within sec, destroyed() is calling.

Don’t know why this happening. Can someone help me Please…

Not sure what is happening to your Actors, but I have a wild idea of something that it MIGHT be:

Are these troublesome Actors a type of Pawn? If so, they might be getting unpossessed by their Controllers, esp. if the Controllers are not replicated also.

Actually, there are of type both Actor and Pawn.

  1. I have this Environment Class (my own custom cpp class for day/Night Cycle) whose parent is an actor. I have inherited blueprint from this class and enabled some replicated variables (like ReplicateMovement, net load on client, Replicate). And this instance doesn’t exit when i load my map, i am creating it at run time in my gameMode’s Beginplay.

  2. At the Server side, when i call any multicast function on this instance, at the client side, this instance is getting created and within sec it is getting destroyed.

And about my player Pawn.
I am creating my player Pawn at runtime in my gameMode’s BeginPlay. I didn’t set this Pawn as defaultPawn in my GameMode. This pawn doesn’t exists on the map while loading.

  1. At the Sever side, a While ago when i was possessing this pawn using a player Controller(instanced using UGameplayStatics::GetPlayerController(GetWorld(), 0)), my player pawn was getting destroyed.

  2. Then i got all instances of playerControllers, iterated through each one and selected a player controller which is also a LocalPlayerController and possessed my player Pawn using this, then it worked fine.

  3. But, at the Client Side, my player Pawn is not created.

  4. At the Server side, when i call any multicast function on my player Pawn, at the client side, the begin play of this pawn is getting called and later it is getting destroyed.

Please tell me where i am doing wrong…

Well, if I enabled Always Relevant to true, then everything is fine.

But, according to this " Net dormancy and Net relevancy - Programming & Scripting - Epic Developer Community Forums" Always Relevant should be false.

If i disable Always Relevant to false and Set NetDormancy = DORM_Initial, it is behaving weirdly.

  1. All Replicated instances are spawning in client only after the first multicast call.

  2. My Pawn Player is Spawning in the client, but he is not moving. The Instance is not getting any updates from the server.

I have lot of actors on my level, so i can’t go with Always Relevant set to true.

The Only Way is NetDormancy…

But I’m not able to understand it fully. Please, can someone help me?

I wish I knew. Can somebody else help?

Problem Solved. Just Update Client pawn Position at server side for every 5 sec.

Hey, what exactly are you doing when you do this ‘Just Update Client pawn Position at server side for every 5 sec’?