Introduction
First of all, I apologise in advance if this is too basic or has already been covered. I spent about 4 hours this afternoon with a colleague trying to figure out how to get and set local variables of one Blueprint class from another. All the tutorials and documentation about “Direct Blueprint Communication”, “Global Variables”, and whatever else we found did not seem to work or help.
To provide further context, I don’t really use Blueprints. I also come from a programming background and getter and setters are incrediebly usefull and important.
Hopefully, this little tutorial will be able to help newcomers to Blueprints.
Simple Counter Example
In this tutorial we will create a simple counter that will increment an integer and then print the result to the screen. To do this, we will be using two Blueprint classes; a counter class and a toggle class.
- Lets first begin by creating the two Blueprints classes (Actor Base Class). Call one of them “Counter” and the other “Toggle”.