Announcement

Collapse
No announcement yet.

How to access created widget class BP to add value to it text

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    How to access created widget class BP to add value to it text

    Hello friends,

    I have a UMG widget with a text "(X value) GOLD" that spawns when the player overlap a gold dropped object.
    For example: the player overlap a gold, a text are created 5 GOLD flying to top and fading off.

    That it's ok and running fine. Before, every gold that I overlap, it spawns it UMG widget for each gold....

    I've changed the logic to spawn just ONE widget at the first overlap, and for each overlap after the first, it will add value to the only one widget created. It's that what I want.


    The problem is:
    I dont know how to access the variable text inside the UMG widget created from the Gold dropped BP.
    So what is happening: The golds are dropped, the first overlaps creates UMG widget text with the value of the gold got, but the sequence of overlaps wont change the value of the created widget.
    I've tried to cast widget class but I just cant change the value of Text variable inside it widget.

    I'm attach the image to show it.


    Thank you and sorry to my bad english. <3


    #2
    Store that value in a game istance and then bind that value to the widget

    Comment


      #3
      Originally posted by Siengried View Post
      Store that value in a game istance and then bind that value to the widget
      thank you friend. I've got it

      Comment


        #4
        Remember, the game istance it's very usefull for get variable shared beetween levels and resources. Use it often.

        Comment

        Working...
        X