C++ variables not showing up in blueprint

Hi there.

So I’ve been having this problem for quite a while and I’m not sure how to solve it.
I declare some variables in my custom class, for example:



public:
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "NewStatus")
			int32 SelectedCmd = 0;


The variable is accessible if I right click in the blueprint.

&stc=1

But it doesn’t appear in the actual variable list.

GraphVarsBP.jpg&stc=1

Am I declaring the variable in a bad way or something? Because that’s like the only thing that comes to my mind.

Also, I tried compiling as Debug Game Editor and Development Editor and it doesn’t seem to make any difference.

Try checking the “Show inherited variables” box.

4 Likes

I tried that, but it doesn’t make a difference. It just shows the inherited variables (in this case from Character).

It works for me with 4.6 and 4.7.
I added a new Character subclass in C++ and added your code snippet.

Can you share your project / blueprint? What UE version are you using?

I agree the inherited variable option should make them appear under a category called New Status according to code snippet you posted.

I managed to get the variables viewable when I tick “Inherited variables” in the blueprint details, but they still won’t show up normally. I’m using 4.6.1 version of the engine. Also, I’d like to add the uasset, but I think it would be kinda pointless. I tried creating a new fresh class and just adding that code to the class and it still doesn’t appear unless I tick Inherited variables. But it’s okay, I’ll have to be content with this.

Yes, I managed to make it appear, but it doesn’t appear as a regular variable as it is shown in many examples. I’d rather not have to tick the inherited variables thingy everytime I open a blueprint and I want to use its variables.

i just thought it could be complaining about “= 0”. You define your Property in Header and usually there is no need (in your case) to set your int32 = 0.

I would try it without it and just write: int32 SelectedCmd;

The variables won’t show up in the list unless you check ‘Show Inherited Variables’. This is normal / expected behaviour. Inherited Variables are all variables that come from the C++ file. You’ll see other variables in there not related just to Character class, but also to Actor, UObject etc.

They’ll also appear in the category you specify, which in your case is ‘New Status’.

you can use them without ticking the “Inherit Variables” Checkbox.

Just rightclick in your Graph and Enter Get or Set MyVariableName (if they are public or protected) and they should show off.