# Are variables in PlayerState classes replicated automatically?

**URL:** <https://forums.unrealengine.com/t/are-variables-in-playerstate-classes-replicated-automatically/69310>\
**Category:** C++\
**Tags:** unreal-engine\
**Created:** [July 18, 2016, 7:56pm UTC](https://forums.unrealengine.com/t/are-variables-in-playerstate-classes-replicated-automatically/69310 "2016-07-18T19:56:48Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![anon87572638](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anon87572638](https://forums.unrealengine.com/u/anon87572638)\
**Post date:** [July 18, 2016, 7:56pm UTC](https://forums.unrealengine.com/t/are-variables-in-playerstate-classes-replicated-automatically/69310/1 "2016-07-18T19:56:48Z")

</div>

Hello dear community,

I have a question you can take right from the topic:

Are variables in PlayerState classes replicated automatically? Or do I have to setup the GetLifetimeReplicatedProps function?  
I tried to implement it but it gives me a lot of errors.

Best wishes,

---

<div class="post-metadata">

**Author:** ![\_neo](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@\_neo](https://forums.unrealengine.com/u/_neo)\
**Post date:** [July 18, 2016, 8:39pm UTC](https://forums.unrealengine.com/t/are-variables-in-playerstate-classes-replicated-automatically/69310/2 "2016-07-18T20:39:13Z")

</div>

Only the ones which are flagged to be replicated.  
What errors are you getting?

---

<div class="post-metadata">

**Author:** ![BrUnO\_XaVIeR](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/bruno_xavier/32/1110230_2.png) [@BrUnO\_XaVIeR](https://forums.unrealengine.com/u/BrUnO_XaVIeR)\
**Post date:** [July 18, 2016, 9:02pm UTC](https://forums.unrealengine.com/t/are-variables-in-playerstate-classes-replicated-automatically/69310/4 "2016-07-18T21:02:03Z")

</div>

You must implement DOREPLIFETIME, and of course they must be UProperty() vars.
