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"

Office Holiday

Epic Games' offices will be on holiday from June 22nd to July 7th. During this period support will be limited. Our offices will reopen on Monday, July 8th. 

AActor::AttachmentReplication is inaccessible

AActor::AttachmentReplication is declared as private but OnRep_AttachmentReplication is virtual so the function can not be overridden and use the AttachmentReplication property as it is inaccessible to inherited classes. Please change the AActor::AttachmentReplication property to be Protected from Private.

Product Version: UE 4.20
more ▼

asked Sep 20 '18 at 10:30 PM in C++ Programming

avatar image

6 1 3

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

1 answer: sort voted first

You got something wrong, if function is virtual you can override while without it you only hide function

 virtual void OnRep_AttachmentReplication() override;

will do the thing

If you really want to change access you can do that yourself by editing engine source code or submit push request but then you need to make solid reasoning behind it. In C++ if varable is private that means there diffrent way to accessing it via function which work like gate keepers, you can at least red that variable via https://api.unrealengine.com/INT/API/Runtime/Engine/GameFramework/AActor/GetAttachmentReplication/index.html

more ▼

answered Sep 21 '18 at 02:05 AM

avatar image

36.6k 931 169 1111

avatar image falconblade Sep 21 '18 at 04:21 AM

If I create an inherited class from AActor and I overwrite the function OnRep_AttachmentReplication, I can not use the AttachmentReplication property that triggered the replication function because it is private in AActor (the parent class). So, it makes overriding the OnRep function useless because there's nothing I can do to change the behavior of AActor for the AttachmentReplication property. If the property were protected, then having the OnRep virtual makes sense because I can then have a child class that can use the variable. I did already change the source, btw, which is no big deal. I think that it'd make sense for the standard engine to have this change as well so that a child class can have access to the AttachmentReplication property of AActor and then overriding the OnRep makes sense. Ultimately, that is up to you guys, though. I'm just the messenger in this case.

avatar image Shadowriver Sep 21 '18 at 04:47 AM

But you want to set that variable?

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
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