[Multiplayer] Hidden actor gets deleted on client
I noticed when setting a replicated actor to be HiddenInGame=True on the server it will get deleted on clients. I need my actors to further exist on the client, as I do some stuff that is actually not necessary to be replicated -> saving some bandwidth. Is there a suitable way of keeping the hidden actor on the client alive?
We solved it by overriding AActor::SetActorHiddenInGame in C++. Do not propagate the call to parent if the parent is AActor. Instead hide the RootComponent and propagate it to the child components. This keeps the actor alive on the clients, but comes with new issues. If you had some components hidden for what ever reason, you will overwrite that by unhiding and need some other logic to handle this problem.
answered Dec 23 '18 at 09:55 AM
I know this is an old question and already have been answered.
but, I have a different solution and I leave it here for a person in future who has same issue.
my solution is overriding 'IsNetRelevantFor' function to make to return true always.
this makes alive an actor even it is hidden in game.
answered Jan 10 '19 at 08:35 AM
Follow this question
Once you sign in you will be able to subscribe for any updates here