I wanna get blueprint variable in C++

279536-

I want to change the value of the variable in this Blueprint class on C++ class

279537-c.png

But… I am a beginner in Unreal Engine.
So I do not know how to get the value.

279538-dsa.png

I’d like to change the Boolean value shown in the picture from c++

Create an interface for it in C++, and have your BP implement that Interface so that it can get and update the variable.

If you do not know how to do this check out my answer to another question where I laid out how to handle C++ Interfaces in both C++ and Blueprints:

Also this handy tutorial where I learned most of my Interface stuff from:

Interfaces are a powerful software development tool, so knowing how to leverage them in general as well as UE4 is a powerful bit of knowledge to know. “Program to an Interface not an implementation” is a core design principle, granted when it was created the “interface” as we know it did not exist, it refered to a “lowest common object” such as AActor or UObject but it still applies today and will make your development much more robust and flexible.

You can do the following:

	UBoolProperty boolProperty = FindField<UBoolProperty>(this->GetClass, TEXT("VariableName"));
	
	if (boolProperty != nullptr)
	{
		bool boolValue = boolProperty->GetPropertyValue_InContainer(this);
	}

That assuming you want to access variable from a inherited blueprint.

That will work, but interfaces are cleaner and better coding practices.