Using buttons in UMG to change integer values.
I am attempting to figure out how to update a value in myplayer blueprint after clicking a button in my widget screen. I am trying to set up a widget that when opened, will let you select the tax rate you want to charge your population with. I have all the values and formulas, just don't know how to update the value after selecting the tax rate button. Any thoughts on this. Been at it for 8 hours watching videos and reading forums.
Any help appreciated.Thanks!
asked Dec 21 '14 at 07:00 AM in Blueprint Scripting
You've created duplicate post my friend. Here are some relating post to answer your question. Instead of using an Event Dispatcher, call a Function on the PlayerController / Character .
More specifically this image here is what you can do in your situation.
I had the same worries when I was first learning UMG.. Your solution is casting my friend!
In your OnClicked function in your widget, you're gonna want to get the Player Character and then cast to the specific character class you're using (I.e. 'MyCharacter') after which you'll be able to access all of the events and variables of your character blueprint!
I do this a lot for in game menus and such, and it works a charm. Let me know if you need any additional help or am example.
Hope this helps!
answered Dec 21 '14 at 01:02 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here