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.
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.
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.
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.
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.
But, at the Client Side, my player Pawn is not created.
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.