# Childclass not replicating like it's parentclass

**URL:** <https://forums.unrealengine.com/t/childclass-not-replicating-like-its-parentclass/84247>\
**Category:** C++\
**Tags:** unreal-engine\
**Created:** [February 2, 2017, 3:39am UTC](https://forums.unrealengine.com/t/childclass-not-replicating-like-its-parentclass/84247 "2017-02-02T03:39:08Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![TommieBommie](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@TommieBommie](https://forums.unrealengine.com/u/TommieBommie)\
**Post date:** [February 2, 2017, 3:39am UTC](https://forums.unrealengine.com/t/childclass-not-replicating-like-its-parentclass/84247/1 "2017-02-02T03:39:08Z")

</div>

Hello,

I bult a hierarchy in C++ as follows:

\_\_\_\_\_\_\_ **ACharacter** \* (Unreal Character class)\*  
\_\_\_\_\_\_\_\_\_\_\_\_ **|**  
\_\_\_\_\_\_\_\_ **ARobotBase** _(replicates fine)_  
\_\_\_\_\_\_\_\_\_ **/** \_\_\_\_\_\_ _\*  
 **ARobotMobile\_\_\_\_**  **ARobotStatic** _ (both don’t replicate movement??)\* ☹

Objects of type RobotBase replicate just fine, but objects of type RobotMobile or RobotStatic don’t replicate their movement. All objects override and call Super:: on following virtual functions:

- BeginPlay()
- Tick( float DeltaSeconds )
- GetLifetimeReplicatedProps(TArray\<FLifetimeProperty\>& OutLifetimeProps)
- SetupPlayerInputComponent(class UInputComponent\* InputComponent)

and in their constructors: ARobot\_Mobile::ARobot\_Mobile(const FObjectInitializer& ObjectInitializer) : Super(ObjectInitializer) {}

I hope my explanation is clear and allows somebody to spot my mistake!  
Thanks a million.

Sincerely,  
Tommie.

---

<div class="post-metadata">

**Author:** ![duke22](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@duke22](https://forums.unrealengine.com/u/duke22)\
**Post date:** [February 2, 2017, 3:49am UTC](https://forums.unrealengine.com/t/childclass-not-replicating-like-its-parentclass/84247/2 "2017-02-02T03:49:05Z")

</div>

This might help (you need to override virtual bool ReplicateSubobjects(class UActorChannel \*Channel, class FOutBunch \*Bunch, FReplicationFlags \*RepFlags) override;)

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

---

<div class="post-metadata">

**Author:** ![TommieBommie](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@TommieBommie](https://forums.unrealengine.com/u/TommieBommie)\
**Post date:** [February 2, 2017, 4:35am UTC](https://forums.unrealengine.com/t/childclass-not-replicating-like-its-parentclass/84247/3 "2017-02-02T04:35:03Z")

</div>

Thanks, I am trying that now not really succeeding yet, as i’m not sure where to add this. Since ARobotMobile and ARobotStatic are both child classes of ARobotBase, shouldnt this all work out of the box? I was never required to add these functions to ARobotBase.

---

<div class="post-metadata">

**Author:** ![TommieBommie](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@TommieBommie](https://forums.unrealengine.com/u/TommieBommie)\
**Post date:** [February 2, 2017, 4:59am UTC](https://forums.unrealengine.com/t/childclass-not-replicating-like-its-parentclass/84247/4 "2017-02-02T04:59:03Z")

</div>

I added:

to \*\* RobotBase.h RobotMobile.h RobotStatic.h \*\* i added:  
\*virtual bool ReplicateSubobjects(class UActorChannel \*Channel, class FOutBunch \*Bunch, FReplicationFlags _RepFlags) override;_

and to\*\* RobotBase.ccp RobotMobile.ccp RobotStatic.ccp\*\* i added:  
\*bool ARobotBase::ReplicateSubobjects(class UActorChannel \*Channel, class FOutBunch \*Bunch, FReplicationFlags _RepFlags)  
{  
return Super::ReplicateSubobjects(Channel, Bunch, RepFlags);;  
}_

but this does not seem to solve the problem. I am not entirely sure if what i am trying to do is correct though.
