Attaching a player to a Player Controller (solved)
I get this error
And I cannot figure out how to attach a player to a Player Controller. The issue is that I need to use "Spawn Actor From Class" to get the player controller, since at the beginning of the game the server and the client are completely different.
I made the player controller class, made a blueprint of it, and now I cannot add widgets to it. It all seemed straightforward but I don't really understand why it doesn't let me add widgets.
Edit: What worked in the end was adding a player manually in the scene and spawning the second player with the second controller set in the gamemode.
You can use the Create Player node in blueprints to create a new player along with its controller.
answered Aug 24 '16 at 08:25 PM
You should not spawn them yourself, PlayerController is created automatically for each player and you can use simple ”Get Player Controller" or to make things a lot easier and cleaner place HUD initiation code in to PlayerController it self, then you don't need to get controller at all and leave pin as it is (or use "Self" node). There other ways to get PlayerController, some classes holds reference to related controller, for example Pawn will have controller that possess it and you can get it via "Get Controller" (it a function of Pawn class).
If you do it in PlayerController this should work in multiplayer too as local PlayerController stays in local computer memoery.
Follow this question
Once you sign in you will be able to subscribe for any updates here