Download

How to access the game state?

Im confused about game mode and game state. Where can I add or access a game state? What info should a game state have that a game mode shouldn’t?

The Game State exists on the server and all clients and can be accessed anywhere and replicated values are available everywhere (I think anyway!) I put a custom game state FSM in mine and things like current match time, players, etc. This way all my connected players know the state of the game, etc. You will probably be doing a lot of Switch Has Authority in your GameState.

My Game Mode feeds into various stuff in my game (well, one thing for now), like how long a Match Length is. I plan on putting victory conditions in my GameMode. That sort of thing. GameMode only exists on the server from what I understand.

I think the key difference between GameMode and GameState is that GameMode is only on the server while GameState is on the server and clients.

https://answers.unrealengine.com/questions/122429/gamemode-vs-gamestate.html
https://docs.unrealengine.com/latest/INT/Gameplay/Framework/GameState/index.html

I want to know where to add a new game state BP or modify the current one. All I see is a game mode slot, and don’t know where get the current game state BP.

Couple ways to do this. First make a new blueprint and use Game State as the parent. Then create another blueprint and use GameMode as the parent. Edit your Game Mode, click Class Settings then on the right set your Game State under “Classes”. You can then set your new Game Mode under World Settings under Game Mode.

You can also override anything and use your custom Game State in your level World Settings under Game Mode. This is going to be the quicker route if you dont need a custom Game Mode.

Would game mode or game state handle respawn?

To get the Game State at run-time, just use the Get Game State BP node. Cast that to your custom Game State BP if you need to.

Hi all how to use scoor from player state to game state to be wine plz need example for this or small tutorial

@alsweiti2017 The player score in the Player state can only be accessed in blueprint (Read only). If you want to add or change the score value you have to do it in C++ (or create a function in C++ that can be accessed in blueprint)