How do i communicate between two blueprints?

I know this question is painfully obvious, even to me, but it’s not as simple as i made it seem…

I have two blueprints: a PickUpCubeLocations blueprint that spawns cubes that serve as power ups and the PowerUpCube that is supposed to serve as a parent class for the cubes themselves.

The PowerUpCube blueprint rotates and communicates with the PickUpCubeLocations blueprint, it also has a variable of type PickUpCubeLocations called LocationsBlueprint.

This is where it gets tricky for me: in the docs i looked up they say you have to drag the blueprint (PowerUpCube) to the editor and set the LocationsBlueprint to PickUpCubeLocations, but i’m not supposed to do so, it’s a class that serves as reference.
I even tried dragging it to the editor and setting the default value of that variable, but i’m still getting errors when i attempt communicate between those blueprints.

Please help!


It looks like you have a null reference there. Where do you set it?

I don’t think i do… What you see in the first screenshot is what you get.
I also tried dragging the PowerUpCube blueprint to the editor and setting it like so:


But still won’t work…

You mean like i’m already doing in the screenshot? :stuck_out_tongue:

Well i tried actually clicking on the actor in the editor (like amongst the walls and such) and still not valid :confused:

When you look at the screenshot from the editor: At the right on the details panel, look at the default section and there you could try to select an instance of your powerupcubelocations BP.

Yes, but with a reference that is not null^^.
Somehow this instance is not valid…

when you want to access some function, variables etc. anything created in another blueprint, you have to use “Cast to” node to tell it exactly where it should look, and then dragging out of “As (blueprint name)” pin, you can call anything inside of that blueprint you have casted to.

It says i don’t need to cast to that blueprint from the variable…

Ok, I really did not read what you wanted to do actually. So what is the point of your logic? (I have read it already but I really don’t know what you want to achieve) One blueprint is spawning cubes. Spawned cubes are driven with another blueprint which rotates them and if you overlap destroys them? Can you post here both of your blueprints?

So there are two blueprints: the PickUpLocations blueprint and the PowerUpCube blueprint. The PickUpLocations blueprint executes a for loop on begin play, spawns three cubes using a random transform from an array of transforms (made from cones i placed in the level) and also adds the locations of those cubes to an array of vectors called Locations.

Then the PowerUpCube blueprint has a BeginOverlap event that supposedly calls the Delete function from the PickUpLocations blueprint, that deletes the location of that cube from the Locations array and spawns a new cube:

This is what i intend to do…

Here is a great, short, official tutorial on how to handle casting.