Why are PlayerState variables not replicating on client?
I have the following two classes in blueprints:
Faction, based on Actor with "Replicates" and "AlwaysRelevant" set to true. Faction contains a PlayerState variable that is set to RepNotify.
MyPlayerState, based on PlayerState with "Replicates" and "AlwaysRelevant" set to true. MyPlayerState contains a Faction variable that is set to RepNotify.
When I start a 2 player network game and level Event BeginPlay occurs, the server spawns and assigns a new Faction to each PlayerState.
On the client, the following sequence of events occurs:
On the client, Faction_C_0.PlayerState never gets set to MyPlayerState_C_8. MyPlayerState_C_8.Faction never gets set to Faction_C_0. These are the instances that are associated with local Player Controller (index 0) on the client, but I'm not sure if that matters.
Why are these two variables not replicated?
The CityArray variable for both Faction instances is replicated. The FactionAction variable is an Actor* I added in C++ in case the replication was buggy only in blueprints, and it is also only replicated for the one Faction instance. An integer variable also replicates for both Faction instances.
asked Oct 03 '15 at 09:39 AM in Using UE4
Follow this question
Once you sign in you will be able to subscribe for any updates here