why can I not access the public variables which I declared in the blueprint editor in my BP?
The BP is a child of my C++ class. The C++ class has one UPROPERTY declared which I can then access from a different blueprint, but I cannot see the variables I declared in the blueprint editor only.
Some variables I created inside the BP editor (not in C++):
Thank you for your answer. I can again access those variables.
I have an additional question, just wondering if I am missing something…
I have another C++ class (Game Instance) from which again I make a BP. In this BP I create variables which I can access, without making a child out of this BP (Get game instance → cost to the BP… etc. and those variables are listed). Why does it work with this BP but not with the aforementioned BP (the C++ is of class Actor)?
You do not need to make a child BP of the parent BP.
MyClass (cpp) → BP_MyClass is enough.
What you want is a variable/pin type that is derived from (or equal to) the class where variables are defined.
If your variable/pin is of type MyClass, you’ll see variables defined in MyClass (cpp) but not blueprint variables.
If your variable/pin is of type BP_MyClass, you’ll see everything.
If your variable is of type MyClass but you know your actual object is of type BP_MyClass, use a Cast to BP_MyClass node and work with its output pin (which is of type BP_MyClass).
Each variable and graph pin has a type. integer, float, string, object…
And the object type splits into as many subtypes as there are object classes available.
Oh you’re right. Maybe the reference variable I had was to the class itself not the BP…
Casting did not come to my mind as I thought it was already of type BP. That will teach me better naming conventions