Announcement

Collapse
No announcement yet.

Communication between UMG Blueprint and another Blueprint

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

    Communication between UMG Blueprint and another Blueprint

    Hi,

    I'm trying to communicate between a UMG blueprint (button pressed) and another blueprint that is holding a model. I'd basically like to set the visibility based on a button press. I've created a custom event in the model's blueprint to be called in the UMG blueprint. I followed this little tutorial on Blueprint communication and whenever I call the IsValid node, on my model's blueprint variable, it returns Not Valid. The model I'm trying to reach in the blueprint, is a subobject of that blueprint, not the entire blueprint. So I am unsure as to why I need a variable at all. Why can't I simply call the custom event?

    https://www.youtube.com/watch?v=xu1a9jFZc7g

    UMG Blueprint:
    Click image for larger version

Name:	Capture.JPG
Views:	1
Size:	70.0 KB
ID:	1149564

    Models Blueprint:
    Click image for larger version

Name:	Capture2.JPG
Views:	1
Size:	53.6 KB
ID:	1149565

    #2
    Where do you set the VB Curved variable? Pointer variables need to point to a spawned object inside the world.
    If you only create the variable and don't set it, the variable will be empty (NULL) and so not valid.

    Check my short tutorial on pointers: https://www.youtube.com/watch?v=PmcaFCMDnqQ

    If you want to connect them, then let your Blueprint spawn the widget and in the widget, set the variable to "Editable" and "Exposed on Spawn".
    When you have the "Create Widget" node inside your BP, there is now a pin with the name of this Variable. Get "Self" and plug it in, so that the Blueprint
    gives himself as a reference over to the spawn widget.
    Open for contracted work | C++/BP (incl. Multiplayer) | Tutoring | VR

    My UE4 Blog/Page with Tutorials and more: Hit me for ALL the things!
    (Including 100+ Pages Multiplayer Network Compendium to get you started.)

    Comment


      #3
      Thank you! I didn't realize I needed to spawn my GUI in the same blueprint that the model I want to manipulate is in. Also, when I spawn the GUI I initialize "VB Curved" to self. Thanks for the help.

      I can't help but think there would be a point later when I might have another blueprint I need to manipulate from the GUI. It seems repetitive to spawn the GUI in that blueprint also. What would be the solution in this case?

      Comment


        #4
        Have a center point for spawnen your things. Actors that need to be accessed later on are better spawned at BeginPlay. Other Actors, like doors or something like that, can be accessed with overlap events
        or line traces (you get Other Actor or Hit Actor from these events). But if you don't have a way to get a reference of the actor by these things, the best thing is to spawn these objects in runtime.
        Then you can directly create a widget and add them. You could have an Array of Actors to manipulate inside the widget and when you spawn the first actor, you check if you have the widget already up. If not,
        create it, if yes, just get the widget (save it inside a variable that you can check) and add the spawned actor to the array inside the widget.

        I guess a more spicific answer can be given if you tell us/me what exactly you are planning to do later on.
        Open for contracted work | C++/BP (incl. Multiplayer) | Tutoring | VR

        My UE4 Blog/Page with Tutorials and more: Hit me for ALL the things!
        (Including 100+ Pages Multiplayer Network Compendium to get you started.)

        Comment

        Working...
        X