Hello,after doing some research about macro and custom event,i think that custom event is very similar to Macro and i am confused about the difference between them,do anyone know the difference between them and when should we use them? thanks~
Custom Events and Macros do look alike but they are implemented differently behind the scenes.
- A Macro copies all of its content every time it is used while a Custom Event references the same implementation. Think of a website then every time you use a Macro it is a complete duplicate where as a Custom Event is just a hyperlink to the source.
- Since a Macro is a new Copy every time it is used it bloats the Blueprint with a lot of unnecessary Properties.
- Derived Blueprints can’t reuse a Macro, but they can reuse and override Custom Events.
- You can’t use a latent Macro in a Function (because the Macro can’t copy a delay into a function) but you can use a latent Custom Event in a Function (because the Custom Event will manage the delay independently of the Function).
What is the benefit of a Macro then you might ask? Well Blueprint created Custom Events can only have a single Execution pin while a Macro can have many, so in some cases it can be beneficial to use a Macro instead of adding extra Branch and Sequence nodes etc.(note they are also Macros).
thanks for answering,now i understand the difference