Can't access C++ variable from Blueprint
Hey there, I'm still trying to figure out how to use C++ with unreal and right now I'm trying to make a variable editable from the blueprint.
The thing is, I'm trying to add this variable in the Pawn class, here's how I'm trying to create it:
Then, I compile the editor in Debug mode and try to create a Blueprint from the base class. In the Blueprint Editor, I mark the "Show Inherited Variables" and I still can't the bTarget variable, but I am able to see all other variables though.
Sorry if it should be easy, but I'm not an expert on C++ nor Unreal so... =P
I believe it has something to do with the fact that it's not a basic type or something.
Assuming you have created a C++ project, if you modify the engine classes, it isn't enough to compile your project editor, you'd have to recompile the UE4 project as well. Why not just add it to your project Character class (if indeed you have a C++ for your project). If it's a bluprint project, you just add the variable to your blueprint.
Also, adding a bTarget to a Pawn break the abstraction. The idea is that not all pawns would necessarily have a target. Not even a Character might have a target. It would be more appropriate to extend the Pawn or Character and give it a target variable.
Follow this question
Once you sign in you will be able to subscribe for any updates here