Spawning a number of actor from a variable of player state (multiplayer)

Hi Iamlazar

I am glad you found my answer helpful. If you wouldn’t mind, could you please upvote it and mark it as the correct answer, so other people can find it who may have similar issues :slight_smile:

if I want to get the variable to put
it on a widget (number of coin added),
I can do that :
Imgur: The magic of the Internet

Yes, you can do that. However, it is far more complicated than it needs to be. I think you are overthinking a lot of your logic.

Widgets only exist on the client. The server does not care about them at all, this is why gameplay logic should be placed in the appropriate objects such as the player controller, game mode, character etc.

If your goal is just to get the variable from the player state, you can simply do this.

  1. In the widget, store a reference to the player state directly from the player controller

  1. Bind the variable from the player state.

If you want to display all the coins collected by all characters, this will require a bit more setup. There are a few approaches you can take with this.

Unfortunately, this page won’t allow me to post all the screenshots etc. So I dumped my solution in a PDF.

[link text][3]

Good luck with your project!

Alex