Can you explain Delagates

Hello, I’m begginner on the c++. I have been following several course about the c++ programming for unreal engine. I realized that delegates are used creating events on unreal engine. But I couldn’t comprehend how do they works. What is the difference beetween functions and delagates. How does Unreal egnine understand When an actor overlaps another actor? By the way I’m non native speaker english can you explain clearly thanks for your helps

You can think of delegates as things that fire off into nothingness. Like speakers- they don’t know who will hear them, they just make the noise.

It also helps that binding a function to a delegate is sometimes referred to as adding a “listener”.

You can bind multiple functions on multiple objects to one delegate and every function bound will fire whenever the delegate is called.


Delegates are good for reducing dependencies on objects that otherwise don’t need to know each-other.

Would a rocket really need to know who fired it, and send a message that it has blown up? No- it can just do it’s own thing, and when it explodes, the person who fired it knows that it blew up from the explosion sound/visual. In this situation the rocket launcher has a delegate in the form of an explosion, and the person who fired it is listening via their ears/eyes.



Objects know when they've overlapped via collision code. Whenever they find they've overlapped with an object, they fire a delegate out. We can then bind to it if we want to use it, but if not it'll just be a speaker in an empty field.