It’s very obvious if you look at blueprint examples that even a fairly simple bit of logic and is quickly hard to follow. Say you want to figure out where to shoot that missile – you need to:
That flow is complex enough – but most of my bullet point are not unreal built-in abilities. Each one probably takes several individual operations – my 13 logical steps might take 50 or 100 individual bits of blueprint, which would be both overwhelming to look at and also very hard to change or upgrade later.
To handle that, it’s a good idea to break up each of these logical tasks into what programmers call ‘functions’ or ‘methods’. In blueprint that’s a single block that has some inputs and outputs . The inputs are the data that you need to do the job and the outputs are any new data that you want to pass along to some other function down the road.
Functions are useful for lots of reasons – they help you organize the layout of what you’re doing to make it easy to read and follow, which just as important as the actual technical inner workings of what you are doing; you’ll spend way more time re-reading and trying to understand your code than you ever spend creating it!. But functions also help you spot what kind of data you need in different parts of what you are doing. One to the classic issues any programmer faces is managing data (see above!) – if you can’t figure out what inputs and outputs you need for a function that’s a sure sign you don’t quite grasp the real problem yet.
Sometimes there are functions without inputs or without outputs (never without both, however!) A no-input function just does gives you some data back – for example, maybe it generates a random message text. A no-output function usually does something to existing objects - maybe it adds an item to a list, or sets a property on some Unreal actor.