How to call a object's function in Blueprint, using the same instance of object exposed in C++?

I have a C++ class that exposes an instance of UFastNoiseWrapper:

	UPROPERTY(EditAnywhere, Category="Test")
	TObjectPtr<UFastNoiseWrapper> Noise;

...

	Noise = CreateDefaultSubobject<UFastNoiseWrapper>(TEXT("Noise"));

UFastNoiseWrapper uses functions rather than properties to change its state, since it’s just a wrapper for the actual noise generator.

I derived a Blueprint from my c++ class that exposes the UFastNoiseWrapper and named it BP_MyNoise. In BP_MyNoise I can see the UFastNoiseWrapper object in the details panel for Class Defaults, but how do I now access that object from within e.g. the construction script in order to call its functions?

I need to edit the same instance rather than just doing something like using a “Construct Fast Noise Wrapper” node, because the goal is to then use the same object in the C++ code for various things, like world generation.

If I understand correctly, you just need to add BlueprintReadWrite in UPROPERTY(), and it will be available to you in your blueprint’s ConstructionScript and EventGraph.

1 Like

That did the trick. I had incorrectly assumed that EditAnywhere already implied BlueprintReadWrite.