Announcement

Collapse
No announcement yet.

Remove from parent clears variables?¿

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

    Remove from parent clears variables?¿

    Hey there i have this BP (see screenshot).

    A message arrives via interface from my character, and this bp gets it and creates a widget.

    All is working fne, but when the UI closes and the Widget is closed... the variables in the widget seem to be clared or restarted.

    How i could fix this, please?Click image for larger version

Name:	Bp.png
Views:	1
Size:	108.9 KB
ID:	1211884

    #2
    Ok i did this:
    From the create widget i promoted the variable.

    Just after Event on inspect i placed a branch; in the condition that variable... with an "Is Valid". If false, then create widget an all. If false, go directly to add to viewport.

    Is this well done? Or i should use other method?

    Comment


      #3
      Ok now i have other problem.

      Its working and it goes to the widget blueprint.

      Now, the first time it shows a text (the bottom one in the screenshot). AS intended. The second time i use the widget, it goes to the array of texts when it should choose one different text each time.

      But what its doing is showing first one text from the array and then (after the time indicated in the delay), showing another.
      It should only show one!

      Again, anyone? lol 8FClick image for larger version

Name:	Bp2.png
Views:	1
Size:	135.0 KB
ID:	1123856

      Comment


        #4
        The widget is destroyed when you remove it from viewport, so the behavior that you are experiencing is correct in your first post. Use Set Visibility to collapse/visible it after creation if you want persistent data.

        As for your second problem, are you creating another widget of the same type with your changes? You also shouldn't need a delay before setting text.
        Marketplace code plugin: AesTargeting - Make your Actors targetable =)

        Comment


          #5
          thank you alot Aesais. The delay node was for other thing, yes; i deleted it and now its working well!

          If you are UP for one more question.... Here it is:

          Now i have it working, and added an integer variable (Veces_?).
          Each time the widget is called, it adds +1 (starting from 0). Then, a branch (the second one in screenshot) see if the integer is less than 8 and, if so, it goes to the Array.

          If its 8 or more... then it goes to the print strings (TESTEST) and set again the variable to 0.

          But.. what is happening is that he goes to the array, and when the integer is 8 or more.. then both things happen. I get the print string, but also the array lol...

          Any idea?

          Click image for larger version

Name:	w3.jpg
Views:	1
Size:	151.8 KB
ID:	1123920

          Comment

          Working...
          X