# Blueprint Components & Replication

**URL:** <https://forums.unrealengine.com/t/blueprint-components-replication/306969>\
**Category:** Blueprint\
**Tags:** replicated-variable, unreal-engine, bug-report, Blueprint, question\
**Created:** [February 15, 2015, 12:23am UTC](https://forums.unrealengine.com/t/blueprint-components-replication/306969 "2015-02-15T00:23:26Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![indygoof](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@indygoof](https://forums.unrealengine.com/u/indygoof)\
**Post date:** [February 15, 2015, 12:23am UTC](https://forums.unrealengine.com/t/blueprint-components-replication/306969/1 "2015-02-15T00:23:26Z")

</div>

4.7 preview 7.  
Created a blueprint (actor) component with various variables, all are set to replicated, also the component itself.  
Added component to Playercontroller, called an event in the component (Run on Server) which sets some variables to their correct values. During that processing i call a multicast event for spawning some effects which rely on some of the variables being replicated; These still are set to none, while having the correct value on the server.

If, instead of setting the variable and letting it replicate, a multicast event with one var as is called, which is then used to set the variable on all clients, everything works correctly.

Update: here a simplified setup in the screenshot for the server and the multicast function (multicast set to reliable since it wont do otherwise).

 ![30030-bug1.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/e/3/5/e3555b8d87525dc81a58ac3ad5af05ee7d0f8cae.png)

When i call Server\_Execute from my PlayerController i then get the following Output:  
Server: true  
Client1: false  
Client2: false

Cheers,

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_e729f54e](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_e729f54e](https://forums.unrealengine.com/u/anonymous_user_e729f54e)\
**Post date:** [February 16, 2015, 4:46pm UTC](https://forums.unrealengine.com/t/blueprint-components-replication/306969/2 "2015-02-16T16:46:25Z")

</div>

Hello ,

I was unable to reproduce this issue on our end. I have a few questions for you that will help narrow down what issue it is that you are experiencing.

Quick questions:

1. Could you show the blueprint that is firing off the Server\_Execute custom event node?
2. Can you reproduce this in a clean project?
3. The screen shots are very helpful, however if you can reproduce this in a clean project, could you provide a detail list of steps to reproduce this on our end?

---

<div class="post-metadata">

**Author:** ![indygoof](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@indygoof](https://forums.unrealengine.com/u/indygoof)\
**Post date:** [February 16, 2015, 8:07pm UTC](https://forums.unrealengine.com/t/blueprint-components-replication/306969/3 "2015-02-16T20:07:03Z")

</div>

Hi Rudy,

even better, i attached a sample project consisting of:

1. A custom GameMode (to have a custom playercharacter and controller)
2. the BP\_Testcomponent with the 2 calls and a replicated var in there
3. a BP\_Controller which calls the Server function inside the component on Left mouse click
4. a BP\_Character which calls the Server function inside the component on Right mouse click

So if you open the project and click on play (at least 2 players) you should see with a left - or right - mouseclick the messages  
Server: true  
Client1: false

So the variable is not replicating (as it has the value “true” on the server and “false” on the client(s)).

Cheers,

link text

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_e729f54e](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_e729f54e](https://forums.unrealengine.com/u/anonymous_user_e729f54e)\
**Post date:** [February 18, 2015, 2:18pm UTC](https://forums.unrealengine.com/t/blueprint-components-replication/306969/4 "2015-02-18T14:18:33Z")

</div>

Hello ,

I was able to reproduce this issue with the project provided. I have written up a report (UE-10013) and I have submitted it to the developers for further consideration. I will provide updates with any pertinent information as it becomes available. Thank you for your information and time.

Make it a great day

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_d9391390](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_d9391390](https://forums.unrealengine.com/u/anonymous_user_d9391390)\
**Post date:** [April 5, 2015, 6:00pm UTC](https://forums.unrealengine.com/t/blueprint-components-replication/306969/5 "2015-04-05T18:00:05Z")

</div>

Hi Rudy,

Is this still broken/can we have an update? I’m still observing that blueprint replication of variables does not work. This is almost two months since this question was first asked, and its a pretty serious bug (for example, I have a multiplayer blueprint driven game that is currently completely broken by this replicating issue). Is the bug fixed on the c++ source? When can we expect a fix on the engine downloaded/compiled by the launcher?

Many thanks,

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_e729f54e](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_e729f54e](https://forums.unrealengine.com/u/anonymous_user_e729f54e)\
**Post date:** [April 6, 2015, 1:13pm UTC](https://forums.unrealengine.com/t/blueprint-components-replication/306969/6 "2015-04-06T13:13:51Z")

</div>

Hello ElliotB,

I went ahead and double checked the status of this issue. However, the status has not be changed to fixed as of yet. This issue is on the developers to do list and I will be sure to bump the community interest for this issue.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_d9391390](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_d9391390](https://forums.unrealengine.com/u/anonymous_user_d9391390)\
**Post date:** [April 6, 2015, 6:24pm UTC](https://forums.unrealengine.com/t/blueprint-components-replication/306969/7 "2015-04-06T18:24:03Z")

</div>

Thanks for the update Rudy! Is there something like a trello/ticket we can view for this issue incase we find anything else to add?

---

<div class="post-metadata">

**Author:** ![lugit\_1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@lugit\_1](https://forums.unrealengine.com/u/lugit_1)\
**Post date:** [April 8, 2015, 5:16pm UTC](https://forums.unrealengine.com/t/blueprint-components-replication/306969/8 "2015-04-08T17:16:21Z")

</div>

Facing the same problem. Quite annoying as i use a modular design, based on scene components - project is currently on HALT because of that

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_e729f54e](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_e729f54e](https://forums.unrealengine.com/u/anonymous_user_e729f54e)\
**Post date:** [April 8, 2015, 6:10pm UTC](https://forums.unrealengine.com/t/blueprint-components-replication/306969/9 "2015-04-08T18:10:54Z")

</div>

Hello lugit,

I went ahead and double checked the status of this issue. However, the status has not be changed to fixed as of yet. This issue is on the developers to do list and I will be sure to bump the community interest for this issue.

---

<div class="post-metadata">

**Author:** ![marotili](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@marotili](https://forums.unrealengine.com/u/marotili)\
**Post date:** [April 12, 2015, 8:22pm UTC](https://forums.unrealengine.com/t/blueprint-components-replication/306969/10 "2015-04-12T20:22:51Z")

</div>

The issue is, that ActorComponent::GetLifetimeReplicatedProps does not include the variables generated in the blueprint. A workaround is to subclass ActorComponent with a component (NetworkActorComponent) that does include those variables. You can then reparent your class to the new component.

I only made a small test, so I don’t know if this works for you, but I hope it helps.

NetworkActorComponent.h

```
#pragma once

#include "NetworkActorComponent.generated.h"

UCLASS(Blueprintable, BlueprintType, meta = (BlueprintSpawnableComponent), Abstract)
class [PROJECT_API] UNetworkActorComponent : public UActorComponent
{
	GENERATED_BODY()

	virtual void GetLifetimeReplicatedProps(TArray<FLifetimeProperty>& OutLifetimeProps) const override;
};

```

NetworkActorComponent.cpp

```
#include "[ProjectPCH].h"
#include "NetworkActorComponent.h"

// This function is copied from ActorReplication.GetLifetimeBlueprintReplicationList, only the class of the first parameter changed
// The first parameter may event not be needed
static void GetLifetimeBlueprintActorComponentReplicationList(const UActorComponent* ThisActorComponent, const UBlueprintGeneratedClass* MyClass, TArray< FLifetimeProperty > & OutLifetimeProps)
{
	if (MyClass == NULL)
	{
		return;
	}
	uint32 PropertiesLeft = MyClass->NumReplicatedProperties;

	for (TFieldIterator<UProperty> It(MyClass, EFieldIteratorFlags::ExcludeSuper); It && PropertiesLeft > 0; ++It)
	{
		UProperty * Prop = *It;
		if (Prop != NULL && Prop->GetPropertyFlags() & CPF_Net)
		{
			PropertiesLeft--;
			OutLifetimeProps.Add(FLifetimeProperty(Prop->RepIndex));
		}
	}

	return GetLifetimeBlueprintActorComponentReplicationList(ThisActorComponent, Cast< UBlueprintGeneratedClass >(MyClass->GetSuperStruct()), OutLifetimeProps);
}

void UNetworkActorComponent::GetLifetimeReplicatedProps(TArray<FLifetimeProperty>& OutLifetimeProps) const
{
	Super::GetLifetimeReplicatedProps(OutLifetimeProps);
	GetLifetimeBlueprintActorComponentReplicationList(this, Cast< UBlueprintGeneratedClass >(GetClass()), OutLifetimeProps);
}

```

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_d9391390](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_d9391390](https://forums.unrealengine.com/u/anonymous_user_d9391390)\
**Post date:** [April 13, 2015, 8:15pm UTC](https://forums.unrealengine.com/t/blueprint-components-replication/306969/11 "2015-04-13T20:15:52Z")

</div>

Any update? Like Lugit I have a modular design based on scene components and cannot make progress because of this flaw.

I have to say I am suprised this issue has not been fixed faster. Am I using a branch that is considered ‘unstable’? I have serious concerns about using ue4 in future projects given that such a core functionality can be so badly broken and remain that way for such a long time.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_e729f54e](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_e729f54e](https://forums.unrealengine.com/u/anonymous_user_e729f54e)\
**Post date:** [April 13, 2015, 8:57pm UTC](https://forums.unrealengine.com/t/blueprint-components-replication/306969/12 "2015-04-13T20:57:03Z")

</div>

Hello ElliotB,

There is not a definite time frame in place for this issue at this time. The status has not be changed to fixed as of yet. I would suggest looking through the next set of release notes for the jira number (UE-10013) that was provided above.

---

<div class="post-metadata">

**Author:** ![marotili](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@marotili](https://forums.unrealengine.com/u/marotili)\
**Post date:** [April 14, 2015, 4:46pm UTC](https://forums.unrealengine.com/t/blueprint-components-replication/306969/13 "2015-04-14T16:46:14Z")

</div>

Hey,

this PR should fix the issue:

There is also a solution that does not require modifying the engine source code. Did you have a look at the answer I posted?
