Which blueprint can talk to which blueprint?

I have a little question about blueprints, and couldn’t find it with googling (I’m currently travelling so unfortunately it was not a thorough search)

Is there an overview of which type of blueprints can communicate with eachother?

In my current project, I constantly run into the issue that certain types blueprints can’t acces other types of blueprints (Widget BP, pawn…) and it is driving me crazy.

Or is there one blueprint type that can be accessed by everything?

You should be able to access variables from other blueprints by using the Cast To node. If you’re unsure of what to plug into the Object pin of a Cast To node, you can simply use the Get All Actors of Class / Get All Widgets of Class nodes. Just select the BP you wanna cast to from the dropdown menu inside those nodes next to their purple pins, drag out of the blue square output pin of those nodes, release your mouse button on an empty space, type in “Get” into the menu that pops up and hit enter to place the Get (copy) node, leave it’s index pin as 0 and connect the Get node’s blue output pin into the Object pin of the Cast To node.

Hope this helps! :blush:

Any BP can talk to any other BP.

May I recommend:

And

Or is there one blueprint type that can be accessed by everything?

Yes, the so called framework - game mode, game instance, player controller, game state, hud.

I’d disagree with this. If you’re unsure, you certainly should not be using those nodes. They’re super useful once you understand what they actually do and when to use them. You absolutely can have a communication heavy project without ever touching those nodes.

2 Likes

Perhaps I shouldn’t have said it like that :sweat_smile:

I wanned to mention that for the OP to reach the objective effortlessly but you’re right!

Nah, it’s all good. I must rant on Get Actors of Class at least once per day.


@Mr_Wijnen feel free to drop an example of who must talk to whom - or follow the links posted above. Note that in order to have actors talk to one another, we must know certain things:

  • how are they spawned, how do they come into play?
  • who spawns them and when?
  • how many are there going to be?
  • do we know about the comms upfront or it’s spontaneous?
  • what is the communication about, what is the actual scenario?

Which method of communication to choose is circumstantial, and more than one approach exists. Note that in 99.9% of cases, it’s not the Cast To that is the issue - it’s often about finding the Target actor / widget / component instance. Once you’ve obtained a reference, things become trivial.

2 Likes

Thanks for the responses! I’ll be looking at both the links you’ve send later, but here is the items that communicate with each other:

a TextProcessor of class Actor with an enemy of class Actor

I have two AI actors that interact with the player and the world, and they are only present in the form of text. The TextProcessor contains the CSV data with all the correct references and I want both actors to call a function from the TextProcessor, get the text from it, and send it to their UI_widget textboxes.

How do they interact? How is the interaction triggered?

I just ended up remaking the system into a easier to understand workflow. I now have a AI controller that talks with the AI pawns. And the AI controller handels everything and is able to talk to all the other codes.

I’m guessing I just tried to make everything to big with a wrong workflow, gotta start small and expand upon that… lesson learned

1 Like