Hi,
I’m having an issue with a variable I’m trying to access not being in scope in the SetupGame() function. I’m currently on lecture 78 in the Unreal Engine C++ Developer course, and I’m trying to access the valid words array in order to pick the HiddenWord from that. In the screenshot, my code is slightly different than where the Github commit is at because I moved the loading of the word list to runtime in order to speed up compile times (see here for the full details).
Currently I can see the issue is that my Isograms variable is not in scope for the SetupGame() function, and so it doesn’t work. To me this is expected, since nothing is passed into the function to use and it’s declared outside. What I don’t understand is why in the lecture’s code the Words variable is accessible (see 2nd screenshot). Nowhere in the SetupGame() function is this passed in or declared, and it doesn’t even appear anywhere else in any other function in the file or even in the header file. For my specific example, it would be great to know of a fix, but I think it may be even better to understand how the Words variable is in scope in the class code. I think once I understand that, fixing my issue won’t be too difficult for me.
Thanks!