Skip to content
dexied edited this page Jul 27, 2026 · 13 revisions

Welcome to the ObjectReplicatorDemo wiki! If the images are not displayed correctly, open them in a new tab!



Installing the plugin

  1. Download the ObjectReplicator plugin in FAB and then enable it in your project.
image image
  1. If you downloaded the plugin from another source, place it in your project folder. The plugin path will look like this: YourProject/Plugins/ObjectReplicator


Introduction

With this plugin you can replicate UObject inside a component. The plugin consists of an object and a component:

  • ReplicatedObject - This is a replicated object, within which any variables can also be replicated. When creating this object, try to specify the owner as the same Actor in which the ReplicatedObjectContainer component is located.

  • ReplicatedObjectContainer - This is a component that contains an array of replicated objects. This component already has a set of functions for working with an array, with automatic registration of objects for replication.


You can use a replicated object for different systems, for example, to create inventory or various effects (buffs, debuffs).



Example

Now, as an example, we will create a simple inventory system.


  1. Create a new blueprint that inherits from ReplicatedObject. I'll call it BP_ItemBase
image
  1. Open this blueprint and add two variables ItemName and ItemCount
image
  1. Make the ItemCount variable replicated as RepNotify
image
  1. Add the OnItemCountUpdated delegate
image image
  1. Convert the OnRep_ItemCount function to an Event and call this delegate there.
image image
  1. For convenience, add several functions to change the ItemCount variable.
image image
  1. Also add the ItemTexture variable!
image
  1. Create two child blueprints from BP_ItemBase. I'll call them BP_AppleItem and BP_WoodItem
image image
  1. Open these blueprints and set some values ​​there
image image

Adding a ReplicatedObjectContainer omponent to your character.

  1. Open your character and add a **ReplicatedObjectContainer component to it
image
  1. Add some test functions inside your character
image image

Create widgets

  1. Create two widgets, name them: W_Item, W_PlayerHUD
image
  1. Open B_Item. Add widget components in the following order.
  • Border

    • HorizontalBox
      • SizeBox
        • Image (ItemTexture)
      • Text (ItemName)
      • Text (ItemCount)
image image
  1. Add the BP_ItemBase variable to W_Item and read data from it on EventConstruct. Also enable ExposeOnSpawn and InstanceEditable in the BP_ItemBase variable settings.
image image
  1. Open the W_PlayerHUD widget and add the VerticalBox there.
image
  1. Open the Graph in this widget and bind to the ReplicatedObjectContainer component
image
  1. All that's left is to create the W_PlayerHUD inside our character after initialization. Open your Character. Create a widget after Possessed event. The widget must be created on the client side.
image

Testing

  1. Run in PlayAsClient mode
image
  1. Press buttons 1, 2, 3 to check that items are being added and everything is replicating correctly!
image image

Everything works!



Additionally

  1. All functions for adding and removing items from a container can be found here.
image
  1. Initialization of an object must occur before adding it to a container, since after adding it to a container, this object will be duplicated and the reference to it will change.
image
  1. You can get the correct reference to the object after adding it to the container like this:
image