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

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 ?

This might help clarify it for you:

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.

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 ?

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

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

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 :slight_smile:

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.