Announcement

Collapse
No announcement yet.

Blueprint to blueprint communication?

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

    Blueprint to blueprint communication?

    Hi all!

    I'd like to achieve the following:
    In Blueprint 1, a series of nodes should fire when an object that is part of Blueprint 2 is clicked in the scene.

    For example: There is a cube in the scene (which is actually part of BP 2). When I click this cube, then a cone in the scene (which is part of BP 1) should move and then rotate.
    How do I communicate between the two blueprints? Can anybody point me to the right direction?

    Thanks!



    #2
    Heya,

    Ok this is one way to do it:

    In BP_Cube1 you could have a reference variable of BP_Cube2. To save on casting etc you could manually set this variable to the BP_Cube2 actor in the world using the eye-dropper and clicking on actor BP_Cube2 in your scene.

    Next you would setup a Blueprint interface called something like BPI_Cube2_DoStuff. In here you would make a function called MoveThenRotate.
    Add this Blueprint interface to the BP_Cube2 blueprint.

    Then you would make an OnClicked event in BP_Cube1 linked either to its StaticMesh component or a trigger box etc.
    Call the event MoveThenRotate (BPI_Cube2_DoStuff message) and link it to your OnClicked event then link the target of the event to your BP_Cube2 reference variable.

    Back in BP_Cube2 in the events graph call the actual event MoveThenRotate. And add your movement logic etc to it.

    So now, you should be able to click on cube1 and it will send a message to cube2 and it will execute the logic you setup.

    Geepers I hope that all makes sense. If not yell out. I wrote it in one go. Anyway I hope that helps in someway. There are quite a few ways you could do this, but yea.

    Comment


      #3
      Hi !

      Thanks, I tried it this way:

      Created a variable manually in 'BP Two' that has the Variable Type set to 'BP One'.
      Created a Custom Event in 'BP One' that is going into the logic set up there.
      When 'BP Two' is clicked it is calling the Custom Event logic set up in 'BP One'. (The 'BP One' reference variable goes int the target here)

      And the custom event logic in 'BP One' is not executed.
      It says: ' Accessed none trying to read property "BP One reference variable name here". ' Blueprint: BP two.

      Comment


        #4
        You need to actually set the BP One to the bp
        YouTube channel: https://m.youtube.com/channel/UC1qaQM1VnY441J5lCLCPMwg

        Comment


          #5
          You mean like this? (Does not work though)

          Attached Files

          Comment


            #6
            nfuchs in the world outliner, you need to point one bp to the other. You have made the variable but u haven't set it...

            Comment


              #7
              Well then I don't understand.
              In the world outliner I can attach one to the other, group them... How is this 'pointing one BP to the other BP' done?

              Comment


                #8
                Ah ok..so there is a default value to the variable with a picker. But it is greyed out, I can't pick anything. Hm...

                Comment


                  #9
                  Found it!
                  I have to pick it in the Details panel not in the Blueprint!
                  And now it works.
                  Thanks!

                  Comment

                  Working...
                  X