I’m trying to use a variable from MyGameInstance in a blueprint constructor however the cast is failing. I have MyGameInstance set in the Maps & Modes so I’m not to sure as to why it’s not working. Any suggestions or ideas to get this to work?
Trying to use persistent values to change default values on newly created objects.
are you running this script from a blueprint actor? also when testing are you actually playing the game? the game instance shouldnt exist until the game is launched so if your dragging around in the viewport it shouldnt work as intended as there is no game instance.
Are you sure you have got the correct Game Instance assigned in Maps & Modes? I know you said you did, but hey, who knows.
That line work for me. Just remember when you migrate folder to your project in my case I was linked the Game Instance to that folder. So, the only thing that I needed to do was go to the Maps & Modes and reassign the Game Instance in that folder again. I was struggling during hours until a get this treat. Thank you so much the fix was very easy.