Announcement

Collapse
No announcement yet.

UMG widget input data to Blueprint fails

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

    UMG widget input data to Blueprint fails

    First of all I am a beginner in UE4, so my knowledge in UE4 is limited. I tried to find suitable solutions in other posts on the forum, but haven't managed to get it working.

    My goal is to figure out some kind of communication between the UMG and Blueprint because I will have a lot of input from UMG's that need to be collected before writing it to a file (as a string). The final product will basically be something like a questionnaire.

    So I am trying to get data from the UMG widget to a blueprint to process it further. In this case I have a textbox to enter a number which is then converted into a file name for saving string data.

    The UMG:
    Click image for larger version

Name:	UMG_EnterPP.jpg
Views:	1
Size:	203.8 KB
ID:	1154621
    The first part is working correctly, getting the data and putting it in variables. It starts to fail when I try to cast it to the blueprint in both of the options. It either fails to cast or the cast is "empty" in the blueprint.

    The Blueprint:
    Click image for larger version

Name:	SaveDataBP.jpg
Views:	1
Size:	151.1 KB
ID:	1154622
    Normally this is how I call for variables from other blueprints without casts, but with UMG it doesn't work.

    I also tried to create a function with UMG as input, setting the variable and have PPSavefileName as output.


    I might be overlooking something or I am just doing it wrong. So please say so if I do and how I can make something like this to work.

    Thanks in advance.

    #2
    The create from class node needs an execution pin. Right now that widget is never created. Also if you promote the return value from the create from class node to a variable, you can use that variable instead of doing a cast.

    Edit: never mind the above, I thought one of the casts was trying to cast the widget. It is still a good idea to save widgets you create in a variable incase you want to do something with them later though. :P

    Check this out: https://answers.unrealengine.com/questions/25747/how-can-i-savegame.html
    Last edited by _cDub; 06-30-2015, 10:04 AM.

    Comment


      #3
      Yeah as cDub said there is no execution pin on the create widget. And you're not adding the widget to the viewport. (You are removing it from the viewport as soon as it's created for some reason) also that's not how cast's are supposed to work. Type casting in programming is changing one object type to another. Like Get Player Controler cast to CustomPlayerClassController.
      Columbus Ohio Unreal Meetup
      @OCGameStudio | Sphere Complex | twitch.tv/WFMOz

      Comment


        #4
        Thank you _cDub & TheFoyer for the replies.

        The widget without an execution pin is executed on play in another blueprint, therefore the widget is removed from screen once the text is committed.
        I am getting that the UMG in the blueprint is "not in scope" or empty, with or without the cast attempt (which was used wrong).

        What appears to be happening (I think) that there is a conflict between my UMG widget and SaveDataBP as I can't compile both of them at once. It is either the one or the other is compiled, never both.
        Though, I don't know if this is related.


        What seems to be the case is that UMG can't communicate with an actor blueprint and vice versa. So what I did to solve this particular problem (forward a variable in UMG) is to communicate with MyCharacter which seems to work fine. Though I haven't solved communicating back to the UMG (yet).
        Last edited by RZ2015; 07-01-2015, 09:25 AM. Reason: Partial solution found

        Comment

        Working...
        X