TextBox content to integer variable in Level

Good day, all of you!

I have a problem with the conversion of the text input by the player to a main menu at the start, then a new level is loaded with the text inputted by the player as a variable. When I run the program, it gives an error with Accessed None.
image

See the blueprints.

This is the logic from the GameMode BP

This is the code for the Main_Menu_Widget

Also the nodes from the Confirm_Button

Can somebody help me in figuring out what I’m doing wrong?

Thank you so much in advance.

GameMode doesnt persist when you switch level map.

so if you are accessing your menu widget in the begin play of your game mode(that you just open level map) it won’t exist yet.

You will need game instance where you can set/get your variable and it will persist through any level map across this game session.

1 Like

Thank you for your reply!

I tried with an instance but still don’t get anything, even an error :smiley:

I changed the a little the GameMode

Got rid of the level change and made a Game_Instance with a variable

Also changed in the widget

Still, the variable doesn’t seem to transfer.

What I’m doing incorrectly?

It worked, my friend. Thank you so much for your tip! Wish you all the best!

For the future strugglers

These are final nodes

From the widget

From the GameInstance

From ConfirmButton

From the GameMode

Hope it helps.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.