# Network programming - a lot of functions and code or something is wrong?

**URL:** <https://forums.unrealengine.com/t/network-programming-a-lot-of-functions-and-code-or-something-is-wrong/57950>\
**Category:** C++\
**Tags:** unreal-engine\
**Created:** [March 11, 2016, 4:28pm UTC](https://forums.unrealengine.com/t/network-programming-a-lot-of-functions-and-code-or-something-is-wrong/57950 "2016-03-11T16:28:56Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![Duetoxplode](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Duetoxplode](https://forums.unrealengine.com/u/Duetoxplode)\
**Post date:** [March 12, 2016, 3:46am UTC](https://forums.unrealengine.com/t/network-programming-a-lot-of-functions-and-code-or-something-is-wrong/57950/2 "2016-03-12T03:46:18Z")

</div>

It sounds like you what you are looking for is Replication.

> **[A new, community-hosted Unreal Engine Wiki](https://forums.unrealengine.com/t/a-new-community-hosted-unreal-engine-wiki/141494)**
>
> After over a year in maintenance mode, the official Unreal Engine Wiki is now permanently offline. These resources now live on a new community-run Unreal Engine Community Wiki — ue4community.wiki! You will be able to find content from the official...

You are achieving replication through RPCs, which also works. If you want to clean up the code a little it’s simpler to set the variables to be replicated.

1. Add UPROPERTY(Replicated) above your variable that you want to be replicated.
2. Implement GetLifetimeReplicatedProps(TArray\< FLifetimeProperty \> & OutLifetimeProps) const
3. Add DOREPLIFETIME(AReplicatedActor, bIsSprinting); in GetLifetimeReplicatedProps

In order for a value to be replicated, it needs to be modified on the server and is then replicated to all clients.  
UPROPERTY(ReplicatedUsing=OnRep\_Flag) also exists, which will call OnRep\_Flag() everytime the variable is replicated.

---

_[View the full topic](https://forums.unrealengine.com/t/network-programming-a-lot-of-functions-and-code-or-something-is-wrong/57950)._
