Replicating Actors in Blueprints

Guide to using the adding Replication to Actors in Blueprints.


This page shows how to use the Replicates option on Actors in order to have them appear (or not appear) on the server versus a client machine. In the two examples cited, the Replicating Actors example shows how to set an Actor to replicate and the difference between a replicated and non-replicated Actor. The second example illustrates how you can dynamically spawn and control where an Actor appears by using the Switch Has Authority node (which checks to see if the server or client is running the script).

Replicating Actors

For this example, we are using the Blueprint Third Person Template with Starter Content.

The steps below illustrate how to set an Actor to Replicate, and the difference between a Replicated Actor and a Non-Replicated Actor.

  1. Inside the Game/StarterContent/Blueprints folder, Right-click on the Blueprint_Effect_Fire and choose Duplicate.


  2. Repeat the previous step to create a second duplicated copy of the Blueprint.

  3. Re-name one of the copies to Fire_NoReplicate and the other to Fire_Replicate.


  4. Open the Fire_NoReplicate Blueprint and click the classDefaults_button.png button, then in the Details Panel, un-check Net Load on Client.


    With this option un-checked, the Actor will not be automatically loaded on the client when the map is loaded. Since Replicates is also not checked, the Actor will not appear on the client's machine at all even if it were spawned in.

  5. Compile and Save, then close the Blueprint and open the Fire_Replicate Blueprint.

  6. Click the classDefaults_button.png button to open the Blueprint Defaults in the Details Panel, then check the Replicates checkbox.


    By checking Replicates, we are saying that this Actor can be replicated on client machines. With Net Load on Client also checked, the Actor is automatically loaded when the map loads and is displayed on client's machines. Where Replicates comes into play is, say you wanted to spawn in this Actor during gameplay at some point instead of on map load, you would need Replicates enabled to say that when the Actor is spawned, go ahead and spawn a replicated copy on client machines.

  7. Compile and Save then close the Blueprint.

  8. From the Content Browser, drag-and-drop the Fire_NoReplicate Blueprint in your level.


  9. From the Content Browser, drag-and-drop the Fire_Replicate Blueprint in your level.


  10. Click the down-arrow next to the Play Button and change the Number of Players option to 2.


  11. Click the Play Button to play in the editor.

    Click to see full-size image.

    When you play in the editor and a new client window is opened, you should notice that the Fire_NoReplicate Blueprint is displayed on the server and not shown on the client. The Fire_Replicate Blueprint however is shown on both the client and the server as depicted above.

Dynamically Spawning Replicated Actors

For this example, we are continuing from the Replicating Actors example above.

The steps below showcase how to dynamically spawn Actors during gameplay using Replication on the server/client.

  1. In the level viewport, delete the Fire_Replicate and Fire_NoReplicate Actors from the level.

  2. From the Place Actors panel in the All Classess tab, drag two Target Points into your level.

    Click to see full-size image.

  3. Rename one Target Point to No_Replicate and the other to Replicate and select both in the World Outliner.


  4. Open the Level Blueprint from the Blueprints menu off the Main Toolbar.


  5. In the Level Blueprint, Right-click in the graph and select the Create References to 2 selected Actors option.


  6. Right-click in the graph again and search for and add the Event Begin Play node.


    While we are using the Event Begin Play node to spawn them in when the game starts, you could swap this for anything else that you would want to use to spawn your Actors in the level during gameplay. This could be anything from a key press to some other kind of dynamic event that occurs which calls for the Actors to spawn.

  7. Right-click in the graph and search for and add the Spawn Actor from Class node and set the Class to Fire_Replicate.

  8. Repeat the previous step to create another Spawn Actor from Class node and set the class to Fire_NoReplicate.

  9. Connect the nodes as shown below.


  10. Drag off the blue Replicate node and search for and add the Get Actor Transform node.

  11. Connect the Get Actor Transform node to the Spawn Transform pin of the Spawn Actor from Class node.

  12. Repeat the previous two steps for the blue No_Replicate node (the results should look similar to below).


    Next we will add the Switch Has Authority (or Authority Guard) node to determine who is executing the script, the Authority (Server) or a Remote Machine (Client). Typically this will be set to Authority to ensure that only the Server can execute gameplay critical scripts such as adjusting health values for players or distributing points, experience, etc. as you do not want to allow a Client machine to cheat by executing these types of scripts.

  13. Drag off the Event Begin Play node and add the Switch Has Authority node.


    Authority should automatically be the default and connect to the first Spawn Actor from Class node.

  14. Compile then close the Level Blueprint and play in the editor.

    Click to see full-size image.

    You should see that since the Server executed the script, both fire effects are shown on the Server while only the one that is set to replicate is shown on the Client. This is useful when you want to spawn something on the Server or Client and not on both, or more importantly, execute any script following the Switch Has Authority node on either the Server or Client (as previously mentioned).

  15. Return to the Level Blueprint and drag off the Remote pin and connect it as shown below.


  16. Compile then close the Level Blueprint and play in the editor.

    Click to see full-size image.

    You should now see that since the Switch Has Authority has been set to Remote, the script following it is only executed on the client machines and not the server. Say for example you had some sort of screen effect that is applied when a player takes damage, using Remote as the Authority Guard, you can spawn that effect only on the remote client that is executing the script.

Select Skin
Help shape the future of Unreal Engine documentation! Tell us how we're doing so we can serve you better.
Take our survey

Welcome to the new Unreal Engine 4 Documentation site!

We're working on lots of new features including a feedback system so you can tell us how we are doing. It's not quite ready for use in the wild yet, so head over to the Documentation Feedback forum to tell us about this page or call out any issues you are encountering in the meantime.

We'll be sure to let you know when the new system is up and running.

Post Feedback