Now that both our C++ class and Blueprint subclass are set up, we can take a look at how they can interact. First up, let's add a variable in C++ that we can use in Blueprint.
In our MyActor.h file in Visual Studio, we can add variables as we normally would. Unreal has a few custom variable types, such as using an FString instead of a standard string, but for now we'll just use a float.
If we simply declared a float in our header file, it would not be accessible in Blueprints. For that, we need to use a special UE4 macro, UPROPERTY. Using this, we can specify where and how our variable can be used. Most commonly, variables exposed to Blueprint need to be accessible anywhere (class defaults, in the Blueprint code itself, and in the level instance properties), as well as be readable and writable.
Let's add a float called TestFloat...