Executing functions over the network
In this section, you will learn how to properly call functions over the network and what the word “authority” really means for the UE multiplayer system. In particular, you will get some insight into which entity should execute a function when it has been called: a client or the server.
Spawning Actors
It is time to start adding pickups at runtime. You are going to achieve this by adding a spawn area Blueprint to the level.
This Blueprint should be able to do the following:
- Choose a random position every time it spawns something
- Spawn random pickups at predefined intervals
- And obviously... behave correctly over the network!
Let’s get started.
Choosing a random spawn position
Let’s start by creating the Blueprint and setting its parameters:
- Create a new Actor Blueprint and call it
BP_Spawner
. - Add a Box Collision component, name it
SpawnArea
, and make it the Scene Root...