Expose C++ variable in Blueprint child class to use it in the Event Graph

Hi!

I’m using Unreal 5.3.2.

I have declared this variable inside public section of a C++ class:

/** The amount of degrees to turn when snap turning */
UPROPERTY(VisibleAnywhere)
float SnapTurnDegrees = -45.0f;

But it doesn’t appear on the child class:

I have also tried with:

/** The amount of degrees to turn when snap turning */
UPROPERTY(BlueprintReadWrite, EditDefaultsOnly)
float SnapTurnDegrees = -45.0f;

But it doesn’t appear.

By the way, I open the editor by clicking on the debug button in Visual Studio.

What can I do to see the variable in child class?

Thanks!

Does visual studio give any error when compile ?

Try to exit unreal and then re-build your project, it can sometime miss update if you use live coding.

The Variables section is only for BP-declared variables, not C++.
Window → Details to open the details panel.
VisibleAnywhere/EditAnywhere should be visible in the details panel as long as you have BP_VRPawn selected in the Components panel.
BlueprintReadWrite should be available in blueprints even if they don’t show up in the Variables panel. Simply right click on the Event Graph and search for your variable name, in this case, SnapTurnDegrees, and you should see an entry to get/set that variable.

2 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.