x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

[Multiplayer] Hidden actor gets deleted on client

Hey there,

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?

Product Version: UE 4.14
Tags:
more ▼

asked Apr 01 '17 at 10:06 PM in Using UE4

avatar image

Rumbleball
259 7 20 20

avatar image chernoburk Dec 23 '18 at 09:32 AM

I found this problem to. Did you solve it?

avatar image Rumbleball Dec 23 '18 at 09:56 AM

Yes, see my answer

(comments are locked)
10|2000 characters needed characters left

2 answers: sort voted first

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.

more ▼

answered Dec 23 '18 at 09:55 AM

avatar image

Rumbleball
259 7 20 20

avatar image chernoburk Dec 23 '18 at 10:54 AM

Okey, i will use set visibility, it less functionaly but safety

(comments are locked)
10|2000 characters needed characters left

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.

more ▼

answered Jan 10 '19 at 08:35 AM

avatar image

STUDIOAI
1 1 1

avatar image STUDIOAI Jan 10 '19 at 08:49 AM

You can just set bAlwaysRelevant = true;

(comments are locked)
10|2000 characters needed characters left
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question