So if i have a replicated variable, and I set a value on the the server, that value is sent across the network to be read by the client, is this correct ?
I have a replicated component, and I can not get the above behavior to function at all.
I have set the variable in the component to replicated, and always relevant, but any changes I make server side are not visible on the client. Where else can I look ?
OK so I set up a simple test - I added a variable (boolean) to player state. Set it in a server side routine, read it on the client. The update is replicated to the client - all working as I thought.
Now I do the same test but with a struct: The update is simply not replicated to the client, and yet I believe that structs ARE supposed to replicate !!
also did the same with a replicated actor, so set a variable in player state to type “rep_actor” which is set to replicate and is always relevant, also the variable is set to replicate also. Spawn an actor on the server and assign that actor to the variable in player state on the server. That actor isn’t replicated on the client.
Just 2 thoughts coming into my mind:
For the components, there’s an extra flag “Component Replicates” in the details section - I assume that you did check that box when you say, you have a replicated component. I did fall into that recently…
What do you mean exactly by struct? At least for Map and Set structures, these are not replicated by design.
Just in case your Struct is in C++: check, that the USTRUCT members you want to be replicated have UPROPERTY() set. This might cause your struct data not being replicated.