Is there a way of wrapping a set of blue print blue and calling it like a function

It’s only my second day, so please forgive me if I’ve missed the obvious

I’ve watched quite a lot of tutorials and read some of the manuals that I found appropriate

I have a 3 sets of blue prints for different types of camera view (mouse view F1, battle view F2 and free mouse F3)

They all work so far, is there a way of tagging the code blocks so that I can call it not only on keypress but on certain scenarios (for instance, when starting the game, or entering a battle area etc)

I could just copy the blocks, but it would be cleaner and more maintable if I call “tag” of the strung together blocks and call them like a function name (“code” re-use)

It is called a macro -

There is some debate as to which is better, a Macro or Function … but that is best left for another thread: Function vs Macro What is better? - Blueprint - Epic Developer Community Forums

Oh… I ended up using neither of those

I made a custom event instead, I didn’t know about these other methods
I call that at initialisation / when I need it. It seems to do the trick (sorry, I searched for hours last night while my post was in moderation)

I’m just searching through what the differences are now, thanks

Search also for PURE functions. They are very handy for small calculations that do not need execution pin.

Have you tried creating a Blueprint Function Library?

If you right click on the content browser and then go to blueprint, then you should see function library, you can then call the functions you make there from any blueprint .

Let me know if this helped :slight_smile: