Blueprint Broadcasting Message Between Blueprints

Scorekeeper BP:

You can create an Event Dispatcher in your Score Keeping Blueprint.

200611-ue_answerpic6a.png

Scorekeeper BP:

When your scorekeeper decides the game is over, it can call the EventDispatcher.

200612-ue_answerpic6b.png

Character BP:

Which will trigger any events that other actors have subscribed to that dispatcher. In your character’s bp’s you’ll want to subscribe to the scorekeeper’s event dispatcher like this…

200613-ue_answerpic6c.png

If you need to find a reference to your scorekeeper, and only have one in your game, you can to the following…

Character BP:

  • [Get All Actors Of Class][4]
  • Then take the first value in the [Array][5], Use the Get node and use an index of 0.
  • The value you get from the array, is your ScoreKeeper, but your BP doesn’t know that, so you need to then cast the value to ScoreKeeper.
  • Then save it in a variable that you can use to drag pins off of.

Another way, would be to store the reference in your GameMode, or have your GameMode keep the score.