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"

Replicating a variable in a custom AGameState breaks playercontroller on client

When I put a replicated variable in a custom C++ AGameState and connect through a session ,the server PlayerController spawns normally but the game breaks on the clients, I'm sure that the BeginPlay() event is not called on all of them no matter what I try.

Product Version: UE 4.13
more ▼

asked Dec 20 '16 at 11:10 AM in C++ Programming

avatar image

25 12 13 15

avatar image Holybreath Dec 20 '16 at 11:43 AM

I'm sure there's a different reason for such behavior. Need more detail. What variable , what it does, are there any methods like OnRep stuff, that may do something funny.

avatar image aa1000 Dec 20 '16 at 01:35 PM

Pretty much any replicated variable with GetLifetimrReplicated breaks the clients, even standard types like float or int32. I don't get any compiling errors.

avatar image ImVawx ♦♦ STAFF Dec 20 '16 at 01:53 PM

Are you calling the Super for GetLifetimeReplicatedProps?

Such as:

 void AActor::GetLifetimeReplicatedProps( TArray< FLifetimeProperty > & OutLifetimeProps ) const
     Super::GetLifetimeReplicatedProps( OutLifetimeProps );
     DOREPLIFETIME( AActor, Owner );
avatar image aa1000 Dec 20 '16 at 06:03 PM

I think i forgot that, I can't replicate the problem because i changed my code around using the game state, but that might have been it.

(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