Linking variables from 3 different blueprints.

I’m making a simple mini game in which you pop 4 ballons and when all of those ballons have been popped a door opens or more or less just gets destroyed.

I made a variable called Ballon Count in my FirstPerson BP with a default value of 0 and also created a variable called Ballon Goal with a value of 4 (they are both integers).

I tried making this idea possible and later on I stopped using the second variable and just used in range for integer and set the min and max to 4.

Here’s a screenshot of my ballon BP, I was able to cast the variable to this new blueprint and promoted it’s set into a new variable in this blueprint but being named the same as in the first person BP.

Here I’m sending you the picture of when the issue happens, I’m always easily able to cast variable from blue prints to blueprint except when It come’s to level blueprints. I would like to know how to get the variable from my ballon BP because even though it is called the same as the one in first person BP it is still a different variable, and how to actually make this work.

I assume the balloons are actors?

You could do a “get all actors of class” if you select your BP Balloon it returns all of them.

I realize that it has to be something like this, but I still struggle with what I should put as an object to Cast to Ballon.

I see, still need some help with the target lol, sry man I’m quite bad at this.

On Event Tick: Get all of the balloons in the level - see how many are there - check if the amount of balloons is 0


I tried this and the door doesn’t disappear.

And just for reference, I’m adding a picture of the door BP

Don’t ever do this: :sweat_smile:
image
or this:

You don’t need to use tick at all for something that can be purley event driven.


Here is a suggestion on how you could achieve this:

  1. Using two actors, one is the baloon and the other the door:
  • The first will be the ‘baloon’:


    It only has to destroy itself when overlapped by the player.

  • For the door first create a variable of type actor and set it as an array. Make it instance editable so that we can pick the balloons we want to be destroyed before opening the door:

  • Next we make sure our array is safe to work with then we bind OnDestroyed event to know when a balloon has been poped:

  • Finally our logic to know when all have been destroyed:

Result:
BPComs


Here are some links about direct BP communication and binding:

Hope it helps

3 Likes

I see, thank you for the response, I’ll try it when I come home and I’ll let you know

Hi, I’m trying this at home and I can’t find myself in your blueprint code, I’m not quite familiar with the arrays and also I want my game to work that the ballon pops when you press E on your keyboard when you’re in his collision box. I would like to know If there is any easier way to do it or a way to do it that is similar to my way but fixed or If you could just dumb it down for me.

Nevermind everyone, sorry for wasting your time, Fuchsnerichen was right all along I just had to fix something little for the door to work as well. Preciate the help and have a nice day.