Networking - Where to spawn actors in blueprints?

To set the stage, I’m trying to develop a card game. The game starts without any cards or decks (these are the actors I need to spawn) on the map so that the player may spawn these in when ready. I’ve tried various places in Blueprints to spawn these cards, but haven’t found a solution that works in multiplayer. I don’t really want to spawn the starting decks in the World Blueprint because I want to transfer the logic to other maps in the future. Here is my current setup:

  1. Game Mode - Only character spawning logic in here at the moment.
  2. Game State - I wanted to spawn the starting decks once (with replication) so I put the spawning logic in here.
  3. Player State - Not much here currently.
  4. Player Controller - Player input logic here.
  5. Player Character - This is where I spawn cards for each player’s hand. It also controls how the cards move via timelines.

The problem is, whenever I cast to the player state or game state and save them as a variables, the client’s (it works fine for the server) variable is blank in the Player Character. To give an example, the Player Character BP attempts to draw a card from their deck so in the Player Character BP I edit all the required variables (such as which card I draw) then I cast to MyGameState to find out the location of their deck so I can spawn the card there and move it to the player’s hand. But the client has a blank variable that refers to MyGameState and it doesn’t work.

Am I setting this up right? Or perhaps, should the Game State be handling the card movement? Or something else entirely?

I can post pictures later if needed. Thanks!

Not in a position to really read your question all right now, but a suggestion is you could create a new blueprint, make it a child of PlayerController. Make sure in your game mode you use this new playercontorller you made.

Then spawn your cards in on begin play in the player controller. See if that helps you.

My main issue was that I wasn’t casting the player controller to get the player state for that character. Once I got this working, my setup above seems like it’s the way to go. Thanks for the help!