Download

Spawn different actors in MP

Hy there.
I’ve a serious problem in spawning different actors from an array/variable in multiplayer.

In a widget called “GameHUD” I have a quick-menu. It’s a kind of inventory where the player can choose his spells. This widget is created in the blueprint MyPlayerController (like the one from the ShootOut-Demo is).
This is the blueprint:

In MyPlayerController I also set the spells. These spells are set in a structure like this: 9765eadee32e668d157066fef10a56ed8007184b.png
These spells are added to the quick-menu like this:


In the event graph of the MyPlayerController it looks like that:

In “GameHUD” I am going to create the HUD for the player and set the spells to the quick-menu. The player is able to click on the spells to choose them. That works fine and looks like this:

In the game the quick-menu is shown correct: 347a07926999c30f64f4ba548c6c3400b4cd2cd3.png and if the player clicks on the spell the spell is going to show up in the lowest field. Like that: qs2.png
The Actor from the structure is also going down to the lowest field.

It works fine until here. But now the problems are going to start…

If I start the game in singleplayer, everything works fine.
If I choose two players, the client is able to choose a spell from the quick-menu, but only the server can spawn the spell(actor). At the client there is a fail showing up. … no, not a fail - I created an isValid an on the client it is NOT valid. It is this one:

I tried different ways… Right now it looks like that:
fd902605aaa780acbaafca692db9ffa987fdce78.png

If the client presses the left mouse button, the event “Server Attempt Spawn Fireball” gets fired. This is replicated and set to “Run on server”. Then the event “Spawn Fireball” gets fired - this is “Run on server”. Now the Spell is going to spawn, but now the event gets called from the server - not the client. That means InGame: The client can only spawn the actor(spell), the server has chosen. If the server is dedicated, nothing is going to spawn.

I also have a video (but no sound - sorry for that).

It is all set like in the MultiplayerShootOut, but it is not working.

Can anyone help me out, please!?

Cheers,
Gerald