im trying to control the way how clients replicate to other clients. I’m level streaming maps and i dont want to replicate for clients not are not in the same map. I came across this function but i have no idea how it works? anyhelp?? Thanks!
As far as i understand you can check if a actor is relevant for replication.
Now in the Replication category in your Actor you can set the distance from witch this actor will replicate to the client.
the problem with this method is that if there is an actor not in the same level stream but within the same replicating distance, that actor will get replicated and look like its floating in the air doing non-sense. I need to create a way that where all the relavent actors in the same level stream will only replicate to each other, and any other actors outside that level stream will not get replicated.
Hello everyone sorry for the long delay in response. So is what I did…
In your Character class you have a virtual function ’ IsNetRelevantFor(const AActor* RealViewer, const AActor* ViewTarget, const FVector& SrcLocation) ’
You want to over load that. RealViewer refers to the player controller, and ViewTarget refers to the Character. These are what you are doing checks on for relevancy and it’s done on the Server side.
In the cpp of your character class, you first want to do a check of a condition that it must absolutely pass. In my case it was to check if the ViewTarget, or Character, was in the same level as me.
After that, if it passed the first check, you should then call the Super for the regular check. is my code
you can do other stuff. I just did a check to see if other players were in the same level stream as me. Anyways thanks for the help and good luck to everyone else!