I am currently developing a system for my game where after the number of players that will be playing has been selected in the main menu, the game goes to a widget where the players need to press enter or start to add their controller to an array of input detectors that will be used from level to level. The main menu and the regular game mode for the levels are 2 different game modes. The problem I am having is when I set the array inside the main menu game mode, I can’t seem to retrieve it in the other game mode.
Where I define and set the 2 arrays (Player Controllers and Input Detectors):
What the arrays look like in the game instance:
Where I try and retrieve the Player Controllers Input Detectors arrays:
When that last For loop executes, it prints out “None”. It does this for both arrays.
It’s worth noting that the game mode switches from the Main Menu game mode to the regular game mode between the first image and the last one. I know that passing variables actually works this way because I already set up a variable to track the number of players alive and it works just fine. The array types are for pawns (input det.) and player controllers.
I’ve been trying everything I can think of for hours on end and I feel like I’m probably just missing something obvious but I have no idea what it is. If anybody can help me, I’d very much appreciate it. Thanks for any/all help!