Cory

View Original

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.

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

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

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.

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