# UObject Replication

**URL:** <https://forums.unrealengine.com/t/uobject-replication/284852>\
**Category:** Programming & Scripting\
**Tags:** unreal-engine\
**Created:** [June 3, 2014, 9:30am UTC](https://forums.unrealengine.com/t/uobject-replication/284852 "2014-06-03T09:30:46Z")\
**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:** [June 3, 2014, 9:30am UTC](https://forums.unrealengine.com/t/uobject-replication/284852/1 "2014-06-03T09:30:46Z")

</div>

So according to this:

> **[Unreal Object Handling](https://docs.unrealengine.com/5.0/en-US/unreal-object-handling/)**
>
> Overview of the features of the UObject system.

UProperties in UObject are automatically replicated.

But from talk on IRC I learned that they are not automatically replicated.

My questions is, what is the deal ? They are replicated or they are not.  
If they are not, why replication doesn’t work by default with UObjects ?

I really liked my things implemented with UObjects, because creating them is much more convinient than Actors, though implementing replication from more or less scaratch looks daunting honestly, and I’m thinking about reimplementing everything using Actors.

---

<div class="post-metadata">

**Author:** ![itsAcren](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/itsacren/32/1194653_2.png) [@itsAcren](https://forums.unrealengine.com/u/itsAcren)\
**Post date:** [June 3, 2014, 11:38am UTC](https://forums.unrealengine.com/t/uobject-replication/284852/2 "2014-06-03T11:38:06Z")

</div>

I’ve been trying to get UObject replication working for a few days.

It seems basic types such as floats replicate, but a pointer to another UObject doesn’t, which is what I’m trying to do ☹

(Even with UPROPERTY(Replicated) and it set in getLifetimeReplicatedProps)

---

<div class="post-metadata">

**Author:** ![gmpreussner\_1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@gmpreussner\_1](https://forums.unrealengine.com/u/gmpreussner_1)\
**Post date:** [June 3, 2014, 3:26pm UTC](https://forums.unrealengine.com/t/uobject-replication/284852/3 "2014-06-03T15:26:02Z")

</div>

The first class in the UObject class hierarchy that implements replication is AActor. All game relevant objects that you wish to be shared between server and clients have to be Actors.

UObject is the most basic class in the Engine’s object system. You can think of it as ‘object’ in C# and Java. A game can have tens of thousands of UObject instances at any given time, many of which are not even relevant to the game. Imagine what would happen if they were all replicated! Hence it is the purpose of AActor to implement game relevant classes that can be replicated.

You said you like UObjects because they are easier to create. Are you perhaps using them simply to transfer data? In that case you may want to consider UStruct properties on your Actors.

If you are using the UObjects to replicate or share behavior, then you may want to consider function replication on your Actor instead.

If you are looking for a way to share data or behavior between different actor classes, or if you want to compartmentalize it to better structure your code, you may also consider [Replicated Actor Components](https://docs.unrealengine.com/latest/INT/Programming/Gameplay/Framework/Networking/Replication/Components/index.html).

---

<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:** [June 3, 2014, 3:40pm UTC](https://forums.unrealengine.com/t/uobject-replication/284852/4 "2014-06-03T15:40:48Z")

</div>

Thanks.  
I’m actually using object, to not just only transfer data, but also to manipulate it in Blueprints. Like apply something at interval, or Cause X when Actor Y is in State Z. Exact behavior is defined using Blueprints.

I rethinked it a bit, and for that matter I don’t really need to replicate those Objects. Maybe one or two properties from them (like the remaining duration in seconds), I only need to replicate the final result that is on Actor (like slower movement of Actor).

I guess I just doesn’t know enough about replication. I have one question though. How do I make sure then, that Object (or Blueprint derived from that Object) is only run on server or other machine with authority ?

---

<div class="post-metadata">

**Author:** ![gmpreussner\_1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@gmpreussner\_1](https://forums.unrealengine.com/u/gmpreussner_1)\
**Post date:** [June 3, 2014, 3:50pm UTC](https://forums.unrealengine.com/t/uobject-replication/284852/5 "2014-06-03T15:50:04Z")

</div>

Yes, you should only replicate the bare minimum and only when it is needed. If only one or two properties are relevant, you can let the Actor class manage those values.

As for running Blueprints only on client or server, that would be a separate AnswerHub question. Doing a [Quick Search](https://docs.unrealengine.com/latest/INT/Search/index.html?q=blueprint+replication&x=0&y=0) reveals that there are already several topics and articles that may be helpful.

---

<div class="post-metadata">

**Author:** ![itsAcren](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/itsacren/32/1194653_2.png) [@itsAcren](https://forums.unrealengine.com/u/itsAcren)\
**Post date:** [June 4, 2014, 12:51am UTC](https://forums.unrealengine.com/t/uobject-replication/284852/6 "2014-06-04T00:51:59Z")

</div>

I’m trying to replicate a somewhat complex data structure on a Component,

i.e the component has 2 ObjectA’s, and a TArray of ObjectB’s

ObjectA has a TArray of ObjectC’s and an Object D

ObjectB may have an Object E

Everything is pretty static. Apart from basic types, references to Object D and E are the only thing that can change over the lifetime of the component.

I thought I could just implement all of these as UObjects, (rather than AActors as they don’t have a world position or components or anything) and selectively replicate the properties that I needed, but what you’re saying goes against this.

How would you recommend doing something like this?

Thanks.

---

<div class="post-metadata">

**Author:** ![Sashka](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Sashka](https://forums.unrealengine.com/u/Sashka)\
**Post date:** [May 31, 2016, 1:50pm UTC](https://forums.unrealengine.com/t/uobject-replication/284852/7 "2016-05-31T13:50:42Z")

</div>

see here about how to replicate an UObject derivative type property:

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