I’m still learning UE and while I’m now able to build some basic blueprints I’m still struggling very much with getting a grasp on how blueprint-to-blueprint communication works, what the proper ways are to call other functions and classes and very much everything else that has to do with calling/integrating functionality that is defined “somewhere else”. I guess I’m just missing a bigger understanding of how “everything” works together and what I can access in what way. So: Can you recommend any tutorials/videos/assays/courses that could help me better understanding these basics?
Because right now I’m just using trial and error making a big mess and I’m sick of it. I want to learn how to do it properly and the basic UE documentation/introduction doesn’t seem to be enough for me
In the most simplest of terms communication requires a reference to the other actor/component (class). To really grasp communication between classes you need to understand class inheritance. Every class derives from a Parent class. Most commonly an Actor (Actor Object Reference).
Take for example the First and Third Person Template Characters. If you walk the inheritance chain backward you would end up at an Actor.
Actor → Pawn → Character → Your Specific Character Class
Hit results (Hit Actor) && Overlaps (Other Actor) are explicitly generic Actor Object References.
Blueprint Interfaces (BPI) is a lighter weight bridge for function based communication that does not require casting. You just need to create specific functions in the BPI. Then implement them in the specific class.
Then there’s Event Dispatcherswhich require class specific references (casted or get all actors of class) and Binding a delegate. This is mainly used for Many to One or One to Many communication.
A “One to Many” example would a be light switch that controls many lights.
In the above code EACH light Actor would get a reference to the Light Switch class and Bind Events to its Dispatchers.
Interacting with the Light Switch would execute the Toggle on/off events which calls the appropriate Event Dispatcher. This is essence broadcasts Turn Lights Off/On and any class that’s has a binding for those events will execute local logic.
A more practical approach would be having the ability to designate specific lights to specific switches.
Add an Actor Tag to the Light Switch instance, then use that tag in a Get All Actors of class with Tag node.
Wow, thank you for all the time you took to craft this answer! Really appreciate it! That is definitely very helpful! I will work through it and play around with the different options!
So… I’m back I worked through your info which helped me a lot (again, thank you) but now I’ve a very specific issue which might be a good example of the kind of problems I’m struggeling to grasp. Again I’m not nesscesarily looking for a solution for this single problem, but I want to reach a point where I can solve this myself. Maybe you have some more ressourced for that?
Let me describe you the issue at hand: I tinkered around some more and stumbled across the Gameplay Ability System. I followed some tutorials to implement it and it works as expected. But now I want to do more. For example from my test-ability blueprint I would like to reach a function that is implemented in my character - or going even further I would like to reach a functionality that is provided by a different component that is added to my character. I know there is some sort of “connection” because the ability can eg trigger animations on my character - but how does this work?
This is a prime example of the part I just don’t really get. How would something like this GAS_Ability be connected to my character that is calling this ability. And how would I navigate this connection. And most importantly: How would I find out myself what type of connection I’m dealing with the next time I’ve an issue reaching some functionality?