Download

Blueprint Communication - FOR THE LOVE OF GOD....HELP ME

This is currently confusing the **** out of me and I’ve been watching tutorials for weeks. As far as I can tell, there are multiple ways to communicate between blueprints:

  1. Custom Events
  2. Blueprint Interfaces
  3. Event Dispatchers

I understand HOW to implement each…BUT I HAVE NO IDEA WHEN TO USE WHICH FORM OF COMMUNICATION!!!. Best practices concerning these would be awesome.

ALSO, on a somewhat related topic…how the HELL do I reference (get or set) a variable from one blueprint (blueprint A) in ANOTHER blueprint (blueprint B?) I keep getting “variable not in scope” messages…

Any insight / info here will earn you a gold star, my friends…

Hello,
Sorry to be obvious but you use them when you need them ^^

For example : If you hit an enemy with a projectile, you need to know enemy hp. In your enemy blueprint you set a variable “hp”. And you need to know the damage you did. Those informations can be in your weapon and your projectile.

Then on hit, your projectile check from your character your variable weapon damage modifier and use it to modify your projectile damage.
Then it checks hit target “hp” (your enemy blueprint) and set new “hp” : “hp” - “damage modified”. Then it set in enemy blueprint (the hit target) a variable “wounded” to true.
And in your enemy blueprint you have an event : wounded = true : play anim “wounded” and sound “arggg”

To reference another blueprint : create a variable then in the list selection type the name of the blueprint. Select it. You have your reference.

There are no better choice as far as I know, you can use them as you whis.

A recent test said that is faster to use direct casting rather than interfaces (but just a few milliseconds)

(You forgot to mention casting as a way to comunnication between BPs)

Maybe using interfaces is better if you need to define some functions used on many BPs, but I did tons of thinks and never used interfaces.

The only you should worry about is to use custom events or functions, but this is a modularity thopic, not really a “bets to use”

The documentation on blueprint communication does provide some examples of which method to use in certain situations, it does not go over every use case, but here are some examples:

Hope that helps! :slight_smile: