# Pointer Replication - Is pointer replicated or object to which pointer, points?

**URL:** <https://forums.unrealengine.com/t/pointer-replication-is-pointer-replicated-or-object-to-which-pointer-points/287560>\
**Category:** Multiplayer & Networking\
**Tags:** Networking, Replication, unreal-engine, CPP, question\
**Created:** [July 6, 2014, 9:34pm UTC](https://forums.unrealengine.com/t/pointer-replication-is-pointer-replicated-or-object-to-which-pointer-points/287560 "2014-07-06T21:34:08Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![iniside](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/iniside/32/866315_2.png) [@iniside](https://forums.unrealengine.com/u/iniside)\
**Post date:** [July 6, 2014, 9:34pm UTC](https://forums.unrealengine.com/t/pointer-replication-is-pointer-replicated-or-object-to-which-pointer-points/287560/1 "2014-07-06T21:34:08Z")

</div>

Pretty much in title.  
When I declare pointer to some Object like Actor, and mark it as Replicated, is the pointer replicated, or there is made copy of object and that copy is replicated ?

---

<div class="post-metadata">

**Author:** ![Naters4lad](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Naters4lad](https://forums.unrealengine.com/u/Naters4lad)\
**Post date:** [July 7, 2014, 12:53am UTC](https://forums.unrealengine.com/t/pointer-replication-is-pointer-replicated-or-object-to-which-pointer-points/287560/2 "2014-07-07T00:53:20Z")

</div>

This might help clarify it for you:  
[http://www.cplusplus.com/doc/tutorial/pointers/](http://www.cplusplus.com/doc/tutorial/pointers/)

Essentially a pointer is just that: A pointer to a reference address. So basically it just says “go here for this”.

An example of this in UE4 code would be something like this:

```
MyGame_LeadCharacter* LC = Cast<MyGame_LeadCharacter>(this->GetController()->GetCharacter());

```

While the above does a bit of casting magic, it also creates a reference type pointer (MyGame\_LeadCharacter\* LC) called LC. LC is now a pointer to the type of LeadCaracter that the above is attempting to cast the current controller’s character to.

---

<div class="post-metadata">

**Author:** ![iniside](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/iniside/32/866315_2.png) [@iniside](https://forums.unrealengine.com/u/iniside)\
**Post date:** [July 7, 2014, 4:39am UTC](https://forums.unrealengine.com/t/pointer-replication-is-pointer-replicated-or-object-to-which-pointer-points/287560/3 "2014-07-07T04:39:47Z")

</div>

I know what pointer is ;). I was curious how does unreal replicate pointers over network.  
Are entire objects send over network, or Unreal just send RPC call to create object type on client ?

---

<div class="post-metadata">

**Author:** ![Naters4lad](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Naters4lad](https://forums.unrealengine.com/u/Naters4lad)\
**Post date:** [July 7, 2014, 4:52am UTC](https://forums.unrealengine.com/t/pointer-replication-is-pointer-replicated-or-object-to-which-pointer-points/287560/4 "2014-07-07T04:52:39Z")

</div>

I’m sorry, I misunderstood your question. 2 minutes of Google searching revealed this 😉

> **[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...

---

<div class="post-metadata">

**Author:** ![Crzyhomer](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Crzyhomer](https://forums.unrealengine.com/u/Crzyhomer)\
**Post date:** [July 7, 2014, 5:51pm UTC](https://forums.unrealengine.com/t/pointer-replication-is-pointer-replicated-or-object-to-which-pointer-points/287560/5 "2014-07-07T17:51:08Z")

</div>

The pointer is not replicated, but the object itself and all things inside setup to replicate are copied exactly. If a member variable isn’t a UPROPERTY or not setup in GetLifetimeReplicatedProps to be replicated, then those values will not come across.

Default Object / Constructor + Current State of the Server for all variables marked to be replicated = Client view of the object

---

<div class="post-metadata">

**Author:** ![iniside](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/iniside/32/866315_2.png) [@iniside](https://forums.unrealengine.com/u/iniside)\
**Post date:** [July 7, 2014, 5:57pm UTC](https://forums.unrealengine.com/t/pointer-replication-is-pointer-replicated-or-object-to-which-pointer-points/287560/6 "2014-07-07T17:57:20Z")

</div>

So just to be clear. I shouldn’t really replicate to many Objects or Actors, as they can quickly eat quite a bit of bandwidth ? Especially Actors tend to be quite big.

---

<div class="post-metadata">

**Author:** ![Crzyhomer](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Crzyhomer](https://forums.unrealengine.com/u/Crzyhomer)\
**Post date:** [July 7, 2014, 6:00pm UTC](https://forums.unrealengine.com/t/pointer-replication-is-pointer-replicated-or-object-to-which-pointer-points/287560/7 "2014-07-07T18:00:51Z")

</div>

Well you can have maybe low-mid 4 figures of AActors, but obviously only if you really need to. We’ve made a lot of optimizations in UE4 to our network code.  
Bandwidth is certainly a premium, and the way you replicate variables and make remote procedure calls should be carefully planned. Less is better always 🙂
