In this recipe, we will see a nontrivial example of replication in use with a simple pickup object that we may want a player to keep track of.
Replicating functions over the network
How to do it...
The first step in creating our collectible would be to actually create the class we are going to use:
- Navigate to File | New C++ Class and from there, in the Choose Parent Class window, select Actor and then click on Next:
- From the next window, set the Name property to CollectibleObject and click on the Create Class button to add it to the project and compile the base code:
- Once Visual Studio opens up, update CollectibleObject.h to the following:
#pragma once
#include "CoreMinimal.h"
#include "GameFramework...