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:
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!
asked Nov 23 '15 at 06:54 PM in Blueprint Scripting
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.
answered Nov 28 '15 at 08:51 AM
Follow this question
Once you sign in you will be able to subscribe for any updates here