I’m using listen server for my lobby map and I’d like to place the player pawns at specific places.
For instance, imagine I have a kind of chess grid and I want to place the player pawns on each cases.
Each time a new player joins the lobby I want to place the pawns automatically.
The pawns cannot be moved by players, it’s just for display during the lobby.
I’m using blueprints, and I wrote the code in the GameMode with OnPostLogin. The host is correctly placed because it’s the server, but when other players join, they stay at the PlayerStart location.
How could I make the server place the other pawns? Aren’t the pawns location replicated automatically?
Could someone give me a hint on how to get it working?
There is a FindPlayerStart and ChoosePlayerStart functions in your GameMode that you can override in order to choose where each player should be placed.
Just create an actor class and drop them in the spots you want. In the GM FindPlayerStart function add code to get all actors of class (your custom point). This will give you an array of those points.
You can then get a copy for anyone of those points, then get the location of it (vector).
My main problem is not getting the right place, it’s to place the player at this point, it seems it doesn’t work, what am I missing?
EDIT: I could make it work in the server (S) but the client (C) doesn’t see his player moved, it is still in the default start location, even if it is set to replicate location: