# \[Replication\] Server not replicating actor to clients

**URL:** <https://forums.unrealengine.com/t/replication-server-not-replicating-actor-to-clients/431771>\
**Category:** Programming & Scripting\
**Tags:** unreal-engine\
**Created:** [August 16, 2018, 3:59pm UTC](https://forums.unrealengine.com/t/replication-server-not-replicating-actor-to-clients/431771 "2018-08-16T15:59:57Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![RyzonPT](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@RyzonPT](https://forums.unrealengine.com/u/RyzonPT)\
**Post date:** [August 16, 2018, 3:59pm UTC](https://forums.unrealengine.com/t/replication-server-not-replicating-actor-to-clients/431771/1 "2018-08-16T15:59:57Z")

</div>

Hi every1, im having a problem with actor replication here.  
I have an actor (a AI) that will use a “spell” and that spell will create an new actor (a buff).  
The AI is spawned on World map so it is rulled by the server.  
When i try to create the new actor (on spell BP) this new actor does not get replciated to clients.

Here the server creates the Actor (buff):

 ![250691-actorcreation.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/0/e/a/0ea77c7fe5fc211593a2467000d476f679776e6e.png)

Here the buff actor will be added to an (RepNotify) array of “player Buffs”

 ![250692-adding.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/6/2/d/62d2f9596f99289e618e9ad0ec5c4ee6faa0d685.png)

Here is the RepNotify func associated with the buff array!

 ![250693-repfunc.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/c/4/5/c457e535998ef37e96d991023f177ac0d08de966.png)

And here is the result

![250694-logs.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/8/9/7/897fbeabb33d8fa0abb779bb939b33cd7961a78b.png)

As you can see, the Client detect that there is 1 element on the array but it is invalid… why?  
All actors are replicated here.  
Shouldnt the replicated actors created on server be replicated to all clients?

---

<div class="post-metadata">

**Author:** ![erikdubbelboer](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@erikdubbelboer](https://forums.unrealengine.com/u/erikdubbelboer)\
**Post date:** [August 17, 2018, 6:37am UTC](https://forums.unrealengine.com/t/replication-server-not-replicating-actor-to-clients/431771/2 "2018-08-17T06:37:04Z")

</div>

Is your Debuff actor set to replicate?

---

<div class="post-metadata">

**Author:** ![RyzonPT](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@RyzonPT](https://forums.unrealengine.com/u/RyzonPT)\
**Post date:** [August 17, 2018, 11:15am UTC](https://forums.unrealengine.com/t/replication-server-not-replicating-actor-to-clients/431771/3 "2018-08-17T11:15:13Z")

</div>

Yes all this actors are set to replicate

---

<div class="post-metadata">

**Author:** ![erikdubbelboer](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@erikdubbelboer](https://forums.unrealengine.com/u/erikdubbelboer)\
**Post date:** [August 17, 2018, 11:24am UTC](https://forums.unrealengine.com/t/replication-server-not-replicating-actor-to-clients/431771/4 "2018-08-17T11:24:34Z")

</div>

I guess it’s possible that the array change gets replicated before the new actor gets created on the client. You can never really depend on the order of things to replicate.

Also keep in mind that BeginPlay for the debuff will be called on the client as well so if you add the debuff to the client there it will get added twice (once from the server though replication) and once on the client itself.

---

<div class="post-metadata">

**Author:** ![RyzonPT](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@RyzonPT](https://forums.unrealengine.com/u/RyzonPT)\
**Post date:** [August 17, 2018, 11:37am UTC](https://forums.unrealengine.com/t/replication-server-not-replicating-actor-to-clients/431771/5 "2018-08-17T11:37:31Z")

</div>

Only the server is adding actors to the array, i will add another image so u can confirm it.  
And i thought the BeginPlay for Debuff should be called on client as u said but for some reason it does not. I will add some prints to show you as well,  
Anyway thank you so much for helping me, im really stressed with this.

Here i added a print to see if Begin play will be called on Clients:

 ![250758-try1.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/d/f/2df96eb673b64d7bf92b20d31bf3f018b4f90c17.png)

][2]

and result is :

![250759-logs2.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/f/b/1/fb1d3e1849ce0a3fe38bab9a2a5fb10baaf7511e.png)

Dont know why tho…

And here is my Add function so u can see only Server will add Buffs/Debuffs to de array

 ![250760-try2.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/5/4/5/5456e5af96225777807c9e691ba6e779dbe64b2c.png)

---

<div class="post-metadata">

**Author:** ![RyzonPT](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@RyzonPT](https://forums.unrealengine.com/u/RyzonPT)\
**Post date:** [August 17, 2018, 11:52am UTC](https://forums.unrealengine.com/t/replication-server-not-replicating-actor-to-clients/431771/6 "2018-08-17T11:52:21Z")

</div>

Btw i just tried what u said, and “forced” the client to wait for the actor creation:

 ![250761-tre5.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/a/f/0/af02785db7e0c4be0bf2fcbf01ff2fc7a417fa5e.png)

 ![250762-try3.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/1/3/7/137cbf8291d6d646286b46c76f655c38f2c37f79.png)

But the result was the same

![250694-logs.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/8/9/7/897fbeabb33d8fa0abb779bb939b33cd7961a78b.png)

---

<div class="post-metadata">

**Author:** ![erikdubbelboer](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@erikdubbelboer](https://forums.unrealengine.com/u/erikdubbelboer)\
**Post date:** [August 17, 2018, 11:55am UTC](https://forums.unrealengine.com/t/replication-server-not-replicating-actor-to-clients/431771/7 "2018-08-17T11:55:19Z")

</div>

It really looks like your Debuff actor isn’t replicated properly. Is Replicates true and is Always Revelant true as well?

---

<div class="post-metadata">

**Author:** ![RyzonPT](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@RyzonPT](https://forums.unrealengine.com/u/RyzonPT)\
**Post date:** [August 17, 2018, 12:17pm UTC](https://forums.unrealengine.com/t/replication-server-not-replicating-actor-to-clients/431771/8 "2018-08-17T12:17:31Z")

</div>

Dam… it was not always Relevant… i didnt knew it was needed  
I thought it had something to do with replication effect range…  
U are my hero… could u explain me why it need to be Always relevant? Solved my problem btw

---

<div class="post-metadata">

**Author:** ![erikdubbelboer](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@erikdubbelboer](https://forums.unrealengine.com/u/erikdubbelboer)\
**Post date:** [August 17, 2018, 12:23pm UTC](https://forums.unrealengine.com/t/replication-server-not-replicating-actor-to-clients/431771/9 "2018-08-17T12:23:56Z")

</div>

Network Relevancy determines if a client should receive updates for certain actors. This is something that isn’t exposed much to Blueprints. In C++ you would overwrite the IsNetRelevantFor function to implement your own rules. For example actors that are too far away from the client aren’t relevant.

See: [Actor Relevancy and Priority | Unreal Engine Documentation](https://docs.unrealengine.com/en-US/Gameplay/Networking/Actors/Relevancy)
