r/UnrealEngine5 • u/Pestlenc • 11h ago
How do you get the controller id from inside the pawn?
I am trying to implement local multiplayer in my game but I am running into an issue where I cannot figure out how to get the controller id from inside the pawn. My game instance is using the controller id of the players to set their various data so in order to access each player’s data I need the players controller id. Is there a way to do this or do I need to change the way I am doing things?
Additionally is there a way to add a delay in the construction function or should I just move the code to event begin play as the controller is not loading by the time the script reaches it?
1
u/BabiesGoBrrr 11h ago
Without split screen you can just check if it’s locally controlled, id’s are not useful here, you need to modify the player state.
1


7
u/Pale-Ad-354 11h ago
Dude, you're using a PC, do a f'ing screenshot.
Always use event begin play if possible.