Primary Data Asset - C++ to Blueprint

Primary Data Asset - C++ to Blueprint

After we create our C++ class that inherits from UDataAsset, I added a few variables as an example. Don’t mind the comments - I was showing students how the comments above UPROPERTY and UFUNCTION will provide in-engine tooltips.

C++.PNG

Next, we right click in the Content Browser -> Miscellaneous and create a Data Asset from out DataExample class.

dataAsset.jpg

Because we used the EditAnywhere descriptor we can double-click our newly created Data Asset and view the properties and even, well - Edit them.

C%2B%2B.jpg
EditAnywhere.PNG

And because we used the Class Specifier BlueprintType - we are able to create a variable in - for example - the ThirdPerson Character of type Data Example and the BlueprintReadWrite descriptor allows us to access those values in Blueprint.

C%2B%2B.jpg
Creatign a variable type for our data.PNG

This can be a really clean way to create and store data across you game objects.

Rust like nighttime

Rust like nighttime

Override Audio Listener

0