Actor Not Replicating When Network Relevant

Here’s the situation.

On the server, I spawn an actor into the world. The actor replicates to the client without a problem and appears on all client.

The client then moves away from the spawned actor, outside of its network relevancy. The spawned actor is then destroyed on the client, which I believe is what is supposed to happen… so far so good.

The client then returns to the location of the spawned actor, but its not there. The server can still see it, but it is no longer there for the client even though the client has returned back to within its network relevancy.

Why does the server stop replicating the actor to the client like this and does not respawn the actor on the client when the client returns back within network relevancy?

After some more testing… it seems as though the network relevancy stops working entirely if you set the Net Cull Distance Squared on the actor too small. I was setting it to 225000.0 just for testing and that seems to cause it to go buggy and stop working.

Oh I also noticed another problem. I spawn an actor (a weapon) into the world from a character’s Begin Play event (just on the ground in front of the character), but I use a Switch Has Authority, so that only the server will spawn it in. However, the network relevancy on this weapon actor seems to have no bearing on the ones spawned for the client characters. The one spawned for the server’s character will disappear as expected when a client gets too far away, however the one spawned for the client character never disappears if the client gets too far away from it. I have made sure to clear the Owner of the actor, so the client doesn’t actually own it, but that makes no difference.

In fact, I’ve also noticed that if I place the weapon actor into the level manually, then it remains network relevant to the client permanently. It doesn’t matter how far away the client gets, even when I go well out of its network relevancy cull distance, it is never destroyed on the client???

There’s a fix in UE4.11 preview for a bug in the NetCullDistanceSquared relevancy test which might be causing this problem.

In UE4.8 to UE4.10 the server was testing the distance from the actor to the origin instead of the distance from the actor to the client character on every other tick.

The fix is at the bottom of FNetViewer::FNetViewer(UNetConnection*, float).

Hey i had the same problem, i dont think this is efficient, but setting Always Relevant to true in the actor class fixed this for me. Try it out for now!