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"

Child actor component has authority on client

Hi,

UE 4.6.1

I noticed that a child actor component is never replicated. For a test, I Created a parent actor class and a child actor class, then I set the child actor class as the child actor component or the parent actor class. I added some logging in the PostInitializeComponents of both parent and child actors and here is what I got:

On the server: LogHSM:Display: Parent Has Authority 1 LogHSM:Display: Child Has Authority 1

On the client: LogHSM:Display: Parent Has Authority 0 LogHSM:Display: Child Has Authority 1

I found no way around this, until I changed engine code as follows in childactorcomponent.h:

virtual bool ReplicateSubobjects(class UActorChannel *Channel, class FOutBunch *Bunch, FReplicationFlags *RepFlags) override { return true; }

After this change I got the expected output:

On the server: LogHSM:Display: Parent Has Authority 1 LogHSM:Display: Child Has Authority 1

On the client: LogHSM:Display: Parent Has Authority 0 LogHSM:Display: Child Has Authority 0

Obviously this was a test change. One way is probably to derive from UChildActorComponent and override the function ReplicateSubobjects, but it seems I need to do this in the engine (in the game dll symbols of UChildActorComponent are not external to the engine.)

Is this the only way I can have child actor components replicated?

Or am I missing something?

Thanks,

Product Version: Not Selected
Tags:
more ▼

asked Mar 07 '15 at 01:18 AM in C++ Programming

avatar image

my_polaris
28 1 3 6

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

0 answers: sort voted first
Be the first one to answer this question
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