Announcement

Collapse
No announcement yet.

UMG Widget Communication

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

    UMG Widget Communication

    Hi there,
    I am trying to solve this thing now for hours but I keep failing. Ive been digging through other Threads but somehow I havent found a solution yet

    So here is what I am trying to do. I am working on an ArchViz and what I want are slightly interactive objects that change their material. There is a tooltip at the top that describes the customer what to do. I basically have the material part, I am stuck at the UMG Part :/.
    So what shall happen on the screen is that there is a ToolTip which says "click space to show interaction triggers" after that it shall say "choose Trigger" and finally once you click on the trigger a little menu pop up menu with several mat options appears and the text says "choose Material". And the last text change, i do not get to work.
    Of course in the end I want to have the same logic on basically more objects
    The 1st image shows the object blueprint of my test vase, in addition I get a an Error message:
    "Error Accessed None 'UMG_Main_Tooltips' from node SetText (Text) in graph 'EventGraph' in blueprint BP_bosa_cut_vase_collection_medium"
    Not sure why I do get it here since I am pointing to my UMG_Main_Tooltips widget :/. How and where do I give this the information it needs?

    Click image for larger version

Name:	Object_blueprint.jpg
Views:	1
Size:	549.0 KB
ID:	1155928
    2nd is the Widget itself
    Click image for larger version

Name:	Widget_blueprint.jpg
Views:	1
Size:	271.5 KB
ID:	1155926

    3rd is the level blueprint
    Click image for larger version

Name:	Level_blueprint.jpg
Views:	1
Size:	109.6 KB
ID:	1155927

    Since I am quite a noob here, maybe I am also having a complete wrong apporach? I saw some threads that focus on text binding etc but I have no idea on how I could use it here.
    I hope you can help me.

    Thanks

    Daniel
    Last edited by DanielN; 07-19-2015, 05:19 PM.

    #2
    hey man,

    refer EventBeginPlay LvlBP: the first thing you should do is when creating your widget save it in a variable and then add it to viewport.

    refer OnClicked (interaction trigger event): The same here when you create your widget save it in a variable. And to remove it from parent use that variable instead
    of dragging the pin from your create widget, which will be zero, since the node never gets fired when trying to remove.

    Just to be explicit give your Create Widget a PlayerController.

    Confusion:

    you create your UMG_Main_Tooltips widget and dont save it, but where is your variable UMG Main Tooltips (inside your red-marked area) coming from?
    Live long and prosper.

    Comment


      #3
      Hi Wallhalla. Thank you for your answer. I think I am a step further. So i saved the widgets in Variables. My problem is that I cannot access the Widget Variable in my object.
      (The UMG Main Tooltips in my red marked area was a Variable with Type Object Reference to my Widget, which stays empty)
      So I need to get my Main_Tooltips Variable from my LvlBP somehow to my Object. But my Object does not know it. And that makes me sad
      Click image for larger version

Name:	Variable.jpg
Views:	1
Size:	434.3 KB
ID:	1082101

      Thanks again

      Daniel

      Comment


        #4
        heh,

        now i am confused.

        somehow to my Object
        can you tell me which object that is?

        And

        So you have your UMG ToolTip Widget which you create inside lvlBP right?

        And what BP Type is your other Blueprint? (with the OnClicked?)
        Live long and prosper.

        Comment


          #5
          Hi thx for the quick answer.
          I explain a bit more in Detail. I am creating my Widget in the level. The Tooltip has always something in it. At first "Press Space for interaction triggers " (of several objects, furniture etc). This gets called by an EventDispatcher in the player. Then the triggers appear above the objects. Once you click on a trigger of the object it shall change the text again. Im not sure what kind of BP Type I have here. I just took a static mesh and edited the BP so I suppose it is a Static Mesh Actor (dont laugh if it is wrong, you are educating a noob here )
          Edit:
          Hm I think I am thinking this wrong. I want to send text to Textbox 105. So I need to communicate with the Widget Blueprint (see 1st post).
          Last edited by DanielN; 07-20-2015, 04:58 PM.

          Comment


            #6
            hmmm, direct communication between lvl and actor could be kind of tricky.

            I dont quite know if there is a proper way to do this, except some ugly hacky ways.

            However, since you have interactable objects in the world and each of them shall display a tooltip what you can do with it, i think the best is to
            set up a tooltip text variable inside each of those.

            Now, when the player enters is in range to interact with the object, the tooltip should appear. So f.e. create your tooltip event inside the PlayerController BP
            and read the text out of the interactable object-> and set it to your blueprint´s textwidget.

            For this you would need to replace your event dispatcher with a proper OnHit event or BeginOverlap or whatever.

            Tbh... i would avoid creating widgets inside the level blueprint.

            maybe this helps
            Live long and prosper.

            Comment


              #7
              Hm I see. So 1st I create the widget in the Character that is no problem. Somehow i would like to try to keep my control setup though. You see when I press Space for the 1st time I "disable" the camera mouse input so that the cursor can take care of choosing materials etc.. I think with your idea, wouldnt I still have the problem that I have to send text to a widget, only in this case from the player instead from an actor. This is what I dont get. I think I am actually currently trying to get a connection between an actor and Widget. I am creating an object Reference Variable of my Target Widget but that thing is not "valid" and I get "accessed none...". So I probably have to do something in my Widget. I simplified the actor BP for less confusion
              Click image for larger version

Name:	simple.jpg
Views:	1
Size:	174.7 KB
ID:	1082117
              I know its asked a lot but maybe you could show how you would send a text to a widget from another actor?
              Thx again

              Comment


                #8
                here is my example, its just a fast way, i dont say this is the best way to do it

                please note: i always used custom function, to have the logic more encapsulated and its easier to read through BP like this (my own feeling).

                So except the 2 Events inside InteractableCube, i created one function for each codepart.

                I havnt used the Remove inside my example but i just wanted to show you how to get rid of a widget reference

                happy coding
                Attached Files
                Last edited by Wallhalla; 07-21-2015, 03:33 AM.
                Live long and prosper.

                Comment


                  #9
                  Thanks four detailed answer. I will give this a try (maybe cry after failing and then comeback)

                  Comment


                    #10
                    have fun
                    Live long and prosper.

                    Comment


                      #11
                      Thank you very much . Sending around the functions works perfectly

                      Comment

                      Working...
                      X