PlayerController On Possess?
Is there a function on the PlayerController class that is called when that player controller possesses a Pawn? I tried overriding the function APlayerController::Possess, but it seems to only be called on the host of the game and doesn't work for anyone joined in a multiplayer game, and it also feels hacky. Simply put, the player picks a loadout, and I want that loadout applied to their possessed pawn when that pawn is possessed. In my mind, the most logical way to do that is store the loadout in the PlayerController (as it will be persistent if the player dies and respawns), then apply that loadout to the pawn when the controller possesses it.
asked Apr 19 '18 at 11:53 PM in C++ Programming
It's related to replication, not all objects are avable to players for decurity reason. GameMode is only existing in host the all players PlayerController exists in host as well player have there controller replicated
answered Apr 20 '18 at 07:00 AM
I use Playercontoller to store information that must persist between Pawns (including dying and respawning). I use PlayerState to store information that must exist on both server and client.
This is because Playercontrollers are NOT the same object on server and client.
Follow this question
Once you sign in you will be able to subscribe for any updates here