Download

What do I need to put into the GameState?

The documentation says:

I have no idea what to put into the game state. Initially I thought I would put everything into the game state that can change, like player position, player variables.

But I think some things are managed without the need to be put into the game state for example I have created a health variable on my character that I marked as replicated.

It seems to be working so far even though I haven’t found a way to debug everything nicely. I am mostly debugging by logging at the moment.

So I think everything that is replicated doesn’t need to be in the game state?

For example if I would drop a weapon at position x,y,z and I would mark that weapon as replicated I would not have to put it into the game state?

What if the server reboots? Will the weapon still be at that position or will it be gone? I guess if I want it to be persistent I would have to put it into the game state and then create a save game object from it?

Hey, you don’t have to put everything that you want replicated into GameState that would be horrible. GameState is like the replicated side of GameMode ( which only exist on server), so if you have a variable inside GameMode that you want the clients to read, you should put this replicated variable inside GameState. PlayerController and PlayerState is similar.

You should look at ShooterGame example it’s really good to learn. Also this if you missed it : https://wiki.unrealengine.com/Replication;