Item spawner

Hi, I’m trying to make an item spawner in multiplayer, but nothing works
If you turn on single player mode, everything is ok, but if you turn on multiplayer, then either it indefinitely places items, that they are not deleted, or it spawns them in all spawners, and not where the player picked them up (2 ways to spawn via get all actors or just spawn an object without get all)
I have a BP_PICKUP object, which is responsible for items
and there is BP_SPAWNER, which should spawn BP_PICKUP once every 5-30 seconds, but it doesn’t work.

The execution logic differs between single-player mode and multiplayer mode. In multiplayer mode, you need to consider the code executed on both the client and the server simultaneously.

The most important thing is that spawning should be done ONLY ON THE SERVER

It is necessary to set the Replicates flag on the objects that you spawn. In this case, the engine will automatically create copies of the spawned actors on all clients.

When you pick up items, you must notify the server about it (call Server RPC Event), or (more correctly) the server copy of the character must interact with collisions, and on the basis of this, certain decisions must be made.
After this the SERVER decides when and what item needs to be spawned.

The entire architecture of your game should be built on the server’s authority. Clients receive ready-made data that is needed for VISUAL copying of the game on the server.

1 Like

Hi @EBUNYT, Ensures only the server controls spawning logic and Allows spawned items and actions to be visible and synchronized for all players.

1 Like