# ActorComponent does not replicate variables to client

**URL:** <https://forums.unrealengine.com/t/actorcomponent-does-not-replicate-variables-to-client/368419>\
**Category:** Blueprint\
**Tags:** Replication, actorcomponent, unreal-engine, bug-report, Blueprint, question\
**Created:** [August 27, 2016, 4:38am UTC](https://forums.unrealengine.com/t/actorcomponent-does-not-replicate-variables-to-client/368419 "2016-08-27T04:38:23Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![GrimlessBBS](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@GrimlessBBS](https://forums.unrealengine.com/u/GrimlessBBS)\
**Post date:** [August 27, 2016, 4:38am UTC](https://forums.unrealengine.com/t/actorcomponent-does-not-replicate-variables-to-client/368419/1 "2016-08-27T04:38:23Z")

</div>

Adding an ActorComponent subclass to a replicating Actor does not replicate value changes in the ActorComponent’s variables to the owning client.

Test case:

1. Create an Actor subclass (called “MyActor”) in blueprints and mark that Actor as Replicates(True).
2. Create an ActorComponent subclass (called “MyAC”) in blueprints. Add this Component to the MyActor blueprint.
3. Add a variable (lets say an Integer variable, called “MyInt”) to the MyAC. Mark it as RepNotify.
4. Put a `PrintString` node in the `OnRep_MyInt` that calls `Get My Int` and prints the value.
5. In the MyActor `EventTick` add a `PrintString` node that gets the MyAC variable and then gets the MyInt variable of that and prints it.
6. Create an event that modifies the MyAC-\>MyInt value on the SERVER side.
7. Notice that the SERVER side value changes correctly and runs `OnRep_MyInt` correctly, but only on the server.
8. Notice that the OWNING\_CLIENT side value never changes and `OnRep_MyInt` is never called on the client.

---

<div class="post-metadata">

**Author:** ![CriErr](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@CriErr](https://forums.unrealengine.com/u/CriErr)\
**Post date:** [August 28, 2016, 5:58am UTC](https://forums.unrealengine.com/t/actorcomponent-does-not-replicate-variables-to-client/368419/2 "2016-08-28T05:58:33Z")

</div>

My guess, your actor component is not set to be replicated.

> **[Component Replication](https://docs.unrealengine.com/4.27/en-US/InteractiveExperiences/Networking/Actors/Components/)**
>
> Setting up components for replication across the network

---

<div class="post-metadata">

**Author:** ![GrimlessBBS](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@GrimlessBBS](https://forums.unrealengine.com/u/GrimlessBBS)\
**Post date:** [August 28, 2016, 6:11am UTC](https://forums.unrealengine.com/t/actorcomponent-does-not-replicate-variables-to-client/368419/3 "2016-08-28T06:11:10Z")

</div>

Why would it run `OnRep_VAR` on the server when the component is not set up to replicate? Secondly, I’m using a custom ActorComponent subclass built in Blueprint as a ‘static actor component’. There does not appear to be a `Component Replicates` checkmark for my custom subclass. Perhaps I built it incorrectly? The variables in the custom subclass are marked for replication and so is the containing Actor.

EDIT: A quick test shows that the `Component Replicates` checkmark does not appear in the Class Defaults of a fresh ActorComponent Blueprint. What am I missing?

---

<div class="post-metadata">

**Author:** ![CriErr](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@CriErr](https://forums.unrealengine.com/u/CriErr)\
**Post date:** [August 28, 2016, 6:35am UTC](https://forums.unrealengine.com/t/actorcomponent-does-not-replicate-variables-to-client/368419/4 "2016-08-28T06:35:56Z")

</div>

Thats all fine questions, but i dont have expertise for it to answer, only guesses based on my blueprint networking experience and according to it, there are was checkmark in 4.8 for sure, but now its gone, while property suggest its should be there.

ActorComponent.h

```
	UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Replicated, Category=ComponentReplication,meta=(DisplayName = "Component Replicates"))
	uint32 bReplicates:1;

```

also its set to be true by default.

---

<div class="post-metadata">

**Author:** ![GrimlessBBS](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@GrimlessBBS](https://forums.unrealengine.com/u/GrimlessBBS)\
**Post date:** [August 28, 2016, 6:56am UTC](https://forums.unrealengine.com/t/actorcomponent-does-not-replicate-variables-to-client/368419/5 "2016-08-28T06:56:54Z")

</div>

Right you are! I see that code in the 4.12 code as well. However, here is the Details panel of my ActorComponent subclass’s Class Defaults:

![104634-screen+shot+2016-08-27+at+23.54.59.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/b/b/f/bbf2e4cc1f2ca6c23ca844ebb488a46dfbb7da91.png)

This is driving me crazy. This seems like it should “just work”. I really really hope I’m just missing something simple. Otherwise, I will have to wait for a patch from Epic, in which case I might as well build my own engine again…

---

<div class="post-metadata">

**Author:** ![GrimlessBBS](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@GrimlessBBS](https://forums.unrealengine.com/u/GrimlessBBS)\
**Post date:** [August 28, 2016, 7:30am UTC](https://forums.unrealengine.com/t/actorcomponent-does-not-replicate-variables-to-client/368419/6 "2016-08-28T07:30:51Z")

</div>

Holy crap! After your recommendation, I did a work-around by calling `Set Is Replicated` in `Event BeginPlay` for my custom ActorComponent subclass and IT WORKED! Would be awesome to have the checkmark back (hint, hint, Epic), but this will do for now. Thanks for the sanity check and push in the right direction @CriErr

EDIT: This issue is related to [https://answers.unrealengine.com/questions/466926/component-replicates-no-longer-displayed-in-editor.html](https://answers.unrealengine.com/questions/466926/component-replicates-no-longer-displayed-in-editor.html)  
Please go vote on that issue for a fix!
