Hi - I’m trying to have a random player affected by a gameplay change a couple of minutes into play, eg they get infected. I’ve used breakpoints and endless print strings. The issue is that no matter what I try, the array doesn’t return a value for the cast to BP_PlayerController to read, it’s always blank.
Gameflow is lobby (select character) → play
Relevant blueprints are:
-
Lobby Game Mode event graph: I use Event OnPostLogin to add/remove all players to an array before game starts
-
Lobby Game Mode function: Use the array that’s collected the player controllers to set a player controller variable in the Game Instance so it’s persistent for when we move into play. I previously had the variable being called from the GameInstance and set here but that didn’t work either
-
GameInstance: PopulatePlayersInGame called from Lobby Game Mode above, and Choose Victim called in the game’s PlayerController blueprint which just calls this event after X seconds.