Location And Team based Spawns
Now you can spread CustomPlayerStart actors in your level and test it. Now you should have a functional Spawn Queue.
You’ll need 3 different Spawn Groups.
- Join Spawn
- Respawn Spawn
Main first spawn point for Characters.
The Things We Did Wrong
- We didn’t use Gamestate.
- We didn’t use Playerstate.
There is some really cool stuff in Gamestate and Playerstate, like getting the ping, player name management. They both survive Server Travel, only when the client gets disconnected Playerstate is destroyed as well Playercontroller and Pawn for that Player.
Playerstate is where player info should be stored. Playerstate exists in server, other clients and in players client. So whatever you put in there it will be visible to everyone.
Gamestate is kinda the same thing. Gamestate should hold values that the server needs to know and needs to replicate to everyone. The static Server Player Class we created should actually be in Gamestate Class.
If we stored Server Player’s info in Gamestate we wouldn’t need to restart Player Controller’s during server travel (server travel means map change).