How do I sent text from current Lv. to Main Menu?


Hi! SO HELP ME GOD! How would I add text to main menu. When my character hits the trigger box I would like the widget to be send to main menu. Text would say (HIGHEST LV COMPLETED: LV 1). So in every level I have trigger box that creates widget and cast it to main menu right away ((while still playing the current level))

Maybe I need game instance. How ever I don’t have SAVE GAME button only RESET, PAUSE, RESUME. Also I have 60 sec.Count Down Timer if that helps. Also I tried combo above but gives me warning error. What should I connect to ((Cast to Main Menu)) in order to correct the warning error??

If any one can help then please teach these noob a valuable lesson!!!

Hi silverfish,

What you might want to do instead of creating a new widget every time is to create a single widget, and bind to a variable of the highest level completed. I made a quick example of how you could do this, so create a bind to your text that displays this information.

110120-umgbind.png

Then you want to create that bind to get the highest level completed as an Int. In my case this is stored in my player character, but you could store it in your gamemode and get GameMode and cast to the gamemode instead. Then I convert that int into a string, and use the Append node to merge those two strings together, then I plug that into the return value which has to be converted into FText automatically.

To test this I went in game and used the + key on my numpad to increase the score and it worked well as shown below -

110132-umgbind3.png

110133-umgbind4.png

So in your game what you need to do is when the player hits the trigger box, it needs to increase the score, then that score is automatically updated within the UMG widget. I hope that solves your issue, if you need more information on UMG Property Binding, please check the documentation here -

Thanks,

Razer313

Also Razer313 how can I set up the trigger box inside my levels to increase the score to be automatically updated. I have no clue and also for some reason High score text is not showing on my menu. I set it up exactly the way you recommend it with integer and then connected in the bind section of that highest lv completed text. Integer I made is inside my game mode as you suggested. I compile and it works except highest lv completed is not showing on my main menu and I know it’s there any idea Razer313. Sorry for taking your time. God bless.

By the way thanks to Razer313 for Super Explanation with pix and everything!!! Thanks man!

How ever if any one knows how to hook up trigger box to increase score so it will be automatically updated in the UMG. That would be super awesome to me!!